!(function(e, t) {
  'object' == typeof exports && 'undefined' != typeof module
    ? (module.exports = t())
    : 'function' == typeof define && define.amd
    ? define(t)
    : ((e = e || self).TIM = t())
})(this, function() {
  var e =
    'undefined' != typeof globalThis
      ? globalThis
      : 'undefined' != typeof window
      ? window
      : 'undefined' != typeof global
      ? global
      : 'undefined' != typeof self
      ? self
      : {}
  function t(e, t) {
    return e((t = { exports: {} }), t.exports), t.exports
  }
  var n = function(e) {
      return e && e.Math == Math && e
    },
    r =
      n('object' == typeof globalThis && globalThis) ||
      n('object' == typeof window && window) ||
      n('object' == typeof self && self) ||
      n('object' == typeof e && e) ||
      Function('return this')(),
    o = function(e) {
      try {
        return !!e()
      } catch (t) {
        return !0
      }
    },
    i = !o(function() {
      return (
        7 !=
        Object.defineProperty({}, 'a', {
          get: function() {
            return 7
          }
        }).a
      )
    }),
    a = {}.propertyIsEnumerable,
    s = Object.getOwnPropertyDescriptor,
    u = {
      f:
        s && !a.call({ 1: 2 }, 1)
          ? function(e) {
              var t = s(this, e)
              return !!t && t.enumerable
            }
          : a
    },
    c = function(e, t) {
      return { enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t }
    },
    l = {}.toString,
    p = function(e) {
      return l.call(e).slice(8, -1)
    },
    h = ''.split,
    f = o(function() {
      return !Object('z').propertyIsEnumerable(0)
    })
      ? function(e) {
          return 'String' == p(e) ? h.call(e, '') : Object(e)
        }
      : Object,
    g = function(e) {
      if (null == e) throw TypeError("Can't call method on " + e)
      return e
    },
    d = function(e) {
      return f(g(e))
    },
    m = function(e) {
      return 'object' == typeof e ? null !== e : 'function' == typeof e
    },
    _ = function(e, t) {
      if (!m(e)) return e
      var n, r
      if (t && 'function' == typeof (n = e.toString) && !m((r = n.call(e)))) return r
      if ('function' == typeof (n = e.valueOf) && !m((r = n.call(e)))) return r
      if (!t && 'function' == typeof (n = e.toString) && !m((r = n.call(e)))) return r
      throw TypeError("Can't convert object to primitive value")
    },
    y = {}.hasOwnProperty,
    v = function(e, t) {
      return y.call(e, t)
    },
    E = r.document,
    S = m(E) && m(E.createElement),
    I = function(e) {
      return S ? E.createElement(e) : {}
    },
    C =
      !i &&
      !o(function() {
        return (
          7 !=
          Object.defineProperty(I('div'), 'a', {
            get: function() {
              return 7
            }
          }).a
        )
      }),
    T = Object.getOwnPropertyDescriptor,
    M = {
      f: i
        ? T
        : function(e, t) {
            if (((e = d(e)), (t = _(t, !0)), C))
              try {
                return T(e, t)
              } catch (n) {}
            if (v(e, t)) return c(!u.f.call(e, t), e[t])
          }
    },
    O = function(e) {
      if (!m(e)) throw TypeError(String(e) + ' is not an object')
      return e
    },
    A = Object.defineProperty,
    D = {
      f: i
        ? A
        : function(e, t, n) {
            if ((O(e), (t = _(t, !0)), O(n), C))
              try {
                return A(e, t, n)
              } catch (r) {}
            if ('get' in n || 'set' in n) throw TypeError('Accessors not supported')
            return 'value' in n && (e[t] = n.value), e
          }
    },
    N = i
      ? function(e, t, n) {
          return D.f(e, t, c(1, n))
        }
      : function(e, t, n) {
          return (e[t] = n), e
        },
    R = function(e, t) {
      try {
        N(r, e, t)
      } catch (n) {
        r[e] = t
      }
      return t
    },
    L = r['__core-js_shared__'] || R('__core-js_shared__', {}),
    P = Function.toString
  'function' != typeof L.inspectSource &&
    (L.inspectSource = function(e) {
      return P.call(e)
    })
  var k,
    G,
    w,
    b = L.inspectSource,
    U = r.WeakMap,
    x = 'function' == typeof U && /native code/.test(b(U)),
    F = t(function(e) {
      ;(e.exports = function(e, t) {
        return L[e] || (L[e] = void 0 !== t ? t : {})
      })('versions', []).push({
        version: '3.6.1',
        mode: 'global',
        copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
      })
    }),
    q = 0,
    V = Math.random(),
    K = function(e) {
      return 'Symbol(' + String(void 0 === e ? '' : e) + ')_' + (++q + V).toString(36)
    },
    B = F('keys'),
    H = function(e) {
      return B[e] || (B[e] = K(e))
    },
    j = {},
    Y = r.WeakMap
  if (x) {
    var $ = new Y(),
      W = $.get,
      z = $.has,
      X = $.set
    ;(k = function(e, t) {
      return X.call($, e, t), t
    }),
      (G = function(e) {
        return W.call($, e) || {}
      }),
      (w = function(e) {
        return z.call($, e)
      })
  } else {
    var J = H('state')
    ;(j[J] = !0),
      (k = function(e, t) {
        return N(e, J, t), t
      }),
      (G = function(e) {
        return v(e, J) ? e[J] : {}
      }),
      (w = function(e) {
        return v(e, J)
      })
  }
  var Q = {
      set: k,
      get: G,
      has: w,
      enforce: function(e) {
        return w(e) ? G(e) : k(e, {})
      },
      getterFor: function(e) {
        return function(t) {
          var n
          if (!m(t) || (n = G(t)).type !== e)
            throw TypeError('Incompatible receiver, ' + e + ' required')
          return n
        }
      }
    },
    Z = t(function(e) {
      var t = Q.get,
        n = Q.enforce,
        o = String(String).split('String')
      ;(e.exports = function(e, t, i, a) {
        var s = !!a && !!a.unsafe,
          u = !!a && !!a.enumerable,
          c = !!a && !!a.noTargetGet
        'function' == typeof i &&
          ('string' != typeof t || v(i, 'name') || N(i, 'name', t),
          (n(i).source = o.join('string' == typeof t ? t : ''))),
          e !== r
            ? (s ? !c && e[t] && (u = !0) : delete e[t], u ? (e[t] = i) : N(e, t, i))
            : u
            ? (e[t] = i)
            : R(t, i)
      })(Function.prototype, 'toString', function() {
        return ('function' == typeof this && t(this).source) || b(this)
      })
    }),
    ee = r,
    te = function(e) {
      return 'function' == typeof e ? e : void 0
    },
    ne = function(e, t) {
      return arguments.length < 2 ? te(ee[e]) || te(r[e]) : (ee[e] && ee[e][t]) || (r[e] && r[e][t])
    },
    re = Math.ceil,
    oe = Math.floor,
    ie = function(e) {
      return isNaN((e = +e)) ? 0 : (e > 0 ? oe : re)(e)
    },
    ae = Math.min,
    se = function(e) {
      return e > 0 ? ae(ie(e), 9007199254740991) : 0
    },
    ue = Math.max,
    ce = Math.min,
    le = function(e, t) {
      var n = ie(e)
      return n < 0 ? ue(n + t, 0) : ce(n, t)
    },
    pe = function(e) {
      return function(t, n, r) {
        var o,
          i = d(t),
          a = se(i.length),
          s = le(r, a)
        if (e && n != n) {
          for (; a > s; ) if ((o = i[s++]) != o) return !0
        } else for (; a > s; s++) if ((e || s in i) && i[s] === n) return e || s || 0
        return !e && -1
      }
    },
    he = { includes: pe(!0), indexOf: pe(!1) },
    fe = he.indexOf,
    ge = function(e, t) {
      var n,
        r = d(e),
        o = 0,
        i = []
      for (n in r) !v(j, n) && v(r, n) && i.push(n)
      for (; t.length > o; ) v(r, (n = t[o++])) && (~fe(i, n) || i.push(n))
      return i
    },
    de = [
      'constructor',
      'hasOwnProperty',
      'isPrototypeOf',
      'propertyIsEnumerable',
      'toLocaleString',
      'toString',
      'valueOf'
    ],
    me = de.concat('length', 'prototype'),
    _e = {
      f:
        Object.getOwnPropertyNames ||
        function(e) {
          return ge(e, me)
        }
    },
    ye = { f: Object.getOwnPropertySymbols },
    ve =
      ne('Reflect', 'ownKeys') ||
      function(e) {
        var t = _e.f(O(e)),
          n = ye.f
        return n ? t.concat(n(e)) : t
      },
    Ee = function(e, t) {
      for (var n = ve(t), r = D.f, o = M.f, i = 0; i < n.length; i++) {
        var a = n[i]
        v(e, a) || r(e, a, o(t, a))
      }
    },
    Se = /#|\.prototype\./,
    Ie = function(e, t) {
      var n = Te[Ce(e)]
      return n == Oe || (n != Me && ('function' == typeof t ? o(t) : !!t))
    },
    Ce = (Ie.normalize = function(e) {
      return String(e)
        .replace(Se, '.')
        .toLowerCase()
    }),
    Te = (Ie.data = {}),
    Me = (Ie.NATIVE = 'N'),
    Oe = (Ie.POLYFILL = 'P'),
    Ae = Ie,
    De = M.f,
    Ne = function(e, t) {
      var n,
        o,
        i,
        a,
        s,
        u = e.target,
        c = e.global,
        l = e.stat
      if ((n = c ? r : l ? r[u] || R(u, {}) : (r[u] || {}).prototype))
        for (o in t) {
          if (
            ((a = t[o]),
            (i = e.noTargetGet ? (s = De(n, o)) && s.value : n[o]),
            !Ae(c ? o : u + (l ? '.' : '#') + o, e.forced) && void 0 !== i)
          ) {
            if (typeof a == typeof i) continue
            Ee(a, i)
          }
          ;(e.sham || (i && i.sham)) && N(a, 'sham', !0), Z(n, o, a, e)
        }
    },
    Re = function(e) {
      if ('function' != typeof e) throw TypeError(String(e) + ' is not a function')
      return e
    },
    Le = function(e, t, n) {
      if ((Re(e), void 0 === t)) return e
      switch (n) {
        case 0:
          return function() {
            return e.call(t)
          }
        case 1:
          return function(n) {
            return e.call(t, n)
          }
        case 2:
          return function(n, r) {
            return e.call(t, n, r)
          }
        case 3:
          return function(n, r, o) {
            return e.call(t, n, r, o)
          }
      }
      return function() {
        return e.apply(t, arguments)
      }
    },
    Pe = function(e) {
      return Object(g(e))
    },
    ke =
      Array.isArray ||
      function(e) {
        return 'Array' == p(e)
      },
    Ge =
      !!Object.getOwnPropertySymbols &&
      !o(function() {
        return !String(Symbol())
      }),
    we = Ge && !Symbol.sham && 'symbol' == typeof Symbol.iterator,
    be = F('wks'),
    Ue = r.Symbol,
    xe = we ? Ue : (Ue && Ue.withoutSetter) || K,
    Fe = function(e) {
      return v(be, e) || (Ge && v(Ue, e) ? (be[e] = Ue[e]) : (be[e] = xe('Symbol.' + e))), be[e]
    },
    qe = Fe('species'),
    Ve = function(e, t) {
      var n
      return (
        ke(e) &&
          ('function' != typeof (n = e.constructor) || (n !== Array && !ke(n.prototype))
            ? m(n) && null === (n = n[qe]) && (n = void 0)
            : (n = void 0)),
        new (void 0 === n ? Array : n)(0 === t ? 0 : t)
      )
    },
    Ke = [].push,
    Be = function(e) {
      var t = 1 == e,
        n = 2 == e,
        r = 3 == e,
        o = 4 == e,
        i = 6 == e,
        a = 5 == e || i
      return function(s, u, c, l) {
        for (
          var p,
            h,
            g = Pe(s),
            d = f(g),
            m = Le(u, c, 3),
            _ = se(d.length),
            y = 0,
            v = l || Ve,
            E = t ? v(s, _) : n ? v(s, 0) : void 0;
          _ > y;
          y++
        )
          if ((a || y in d) && ((h = m((p = d[y]), y, g)), e))
            if (t) E[y] = h
            else if (h)
              switch (e) {
                case 3:
                  return !0
                case 5:
                  return p
                case 6:
                  return y
                case 2:
                  Ke.call(E, p)
              }
            else if (o) return !1
        return i ? -1 : r || o ? o : E
      }
    },
    He = {
      forEach: Be(0),
      map: Be(1),
      filter: Be(2),
      some: Be(3),
      every: Be(4),
      find: Be(5),
      findIndex: Be(6)
    },
    je = function(e, t) {
      var n = [][e]
      return (
        !n ||
        !o(function() {
          n.call(
            null,
            t ||
              function() {
                throw 1
              },
            1
          )
        })
      )
    },
    Ye = He.forEach,
    $e = je('forEach')
      ? function(e) {
          return Ye(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
      : [].forEach
  Ne({ target: 'Array', proto: !0, forced: [].forEach != $e }, { forEach: $e })
  var We = function(e, t, n, r) {
      try {
        return r ? t(O(n)[0], n[1]) : t(n)
      } catch (i) {
        var o = e.return
        throw (void 0 !== o && O(o.call(e)), i)
      }
    },
    ze = {},
    Xe = Fe('iterator'),
    Je = Array.prototype,
    Qe = function(e) {
      return void 0 !== e && (ze.Array === e || Je[Xe] === e)
    },
    Ze = function(e, t, n) {
      var r = _(t)
      r in e ? D.f(e, r, c(0, n)) : (e[r] = n)
    },
    et = {}
  et[Fe('toStringTag')] = 'z'
  var tt = '[object z]' === String(et),
    nt = Fe('toStringTag'),
    rt =
      'Arguments' ==
      p(
        (function() {
          return arguments
        })()
      ),
    ot = tt
      ? p
      : function(e) {
          var t, n, r
          return void 0 === e
            ? 'Undefined'
            : null === e
            ? 'Null'
            : 'string' ==
              typeof (n = (function(e, t) {
                try {
                  return e[t]
                } catch (n) {}
              })((t = Object(e)), nt))
            ? n
            : rt
            ? p(t)
            : 'Object' == (r = p(t)) && 'function' == typeof t.callee
            ? 'Arguments'
            : r
        },
    it = Fe('iterator'),
    at = function(e) {
      if (null != e) return e[it] || e['@@iterator'] || ze[ot(e)]
    },
    st = function(e) {
      var t,
        n,
        r,
        o,
        i,
        a = Pe(e),
        s = 'function' == typeof this ? this : Array,
        u = arguments.length,
        c = u > 1 ? arguments[1] : void 0,
        l = void 0 !== c,
        p = 0,
        h = at(a)
      if ((l && (c = Le(c, u > 2 ? arguments[2] : void 0, 2)), null == h || (s == Array && Qe(h))))
        for (n = new s((t = se(a.length))); t > p; p++) Ze(n, p, l ? c(a[p], p) : a[p])
      else
        for (i = (o = h.call(a)).next, n = new s(); !(r = i.call(o)).done; p++)
          Ze(n, p, l ? We(o, c, [r.value, p], !0) : r.value)
      return (n.length = p), n
    },
    ut = Fe('iterator'),
    ct = !1
  try {
    var lt = 0,
      pt = {
        next: function() {
          return { done: !!lt++ }
        },
        return: function() {
          ct = !0
        }
      }
    ;(pt[ut] = function() {
      return this
    }),
      Array.from(pt, function() {
        throw 2
      })
  } catch (kd) {}
  var ht = function(e, t) {
      if (!t && !ct) return !1
      var n = !1
      try {
        var r = {}
        ;(r[ut] = function() {
          return {
            next: function() {
              return { done: (n = !0) }
            }
          }
        }),
          e(r)
      } catch (kd) {}
      return n
    },
    ft = !ht(function(e) {
      Array.from(e)
    })
  Ne({ target: 'Array', stat: !0, forced: ft }, { from: st })
  var gt,
    dt =
      Object.keys ||
      function(e) {
        return ge(e, de)
      },
    mt = i
      ? Object.defineProperties
      : function(e, t) {
          O(e)
          for (var n, r = dt(t), o = r.length, i = 0; o > i; ) D.f(e, (n = r[i++]), t[n])
          return e
        },
    _t = ne('document', 'documentElement'),
    yt = H('IE_PROTO'),
    vt = function() {},
    Et = function(e) {
      return '<script>' + e + '</script>'
    },
    St = function() {
      try {
        gt = document.domain && new ActiveXObject('htmlfile')
      } catch (kd) {}
      var e, t
      St = gt
        ? (function(e) {
            e.write(Et('')), e.close()
            var t = e.parentWindow.Object
            return (e = null), t
          })(gt)
        : (((t = I('iframe')).style.display = 'none'),
          _t.appendChild(t),
          (t.src = String('javascript:')),
          (e = t.contentWindow.document).open(),
          e.write(Et('document.F=Object')),
          e.close(),
          e.F)
      for (var n = de.length; n--; ) delete St.prototype[de[n]]
      return St()
    }
  j[yt] = !0
  var It =
    Object.create ||
    function(e, t) {
      var n
      return (
        null !== e
          ? ((vt.prototype = O(e)), (n = new vt()), (vt.prototype = null), (n[yt] = e))
          : (n = St()),
        void 0 === t ? n : mt(n, t)
      )
    }
  Ne({ target: 'Object', stat: !0, sham: !i }, { create: It })
  var Ct = o(function() {
    dt(1)
  })
  Ne(
    { target: 'Object', stat: !0, forced: Ct },
    {
      keys: function(e) {
        return dt(Pe(e))
      }
    }
  )
  var Tt,
    Mt,
    Ot,
    At = function(e) {
      return function(t, n) {
        var r,
          o,
          i = String(g(t)),
          a = ie(n),
          s = i.length
        return a < 0 || a >= s
          ? e
            ? ''
            : void 0
          : (r = i.charCodeAt(a)) < 55296 ||
            r > 56319 ||
            a + 1 === s ||
            (o = i.charCodeAt(a + 1)) < 56320 ||
            o > 57343
          ? e
            ? i.charAt(a)
            : r
          : e
          ? i.slice(a, a + 2)
          : o - 56320 + ((r - 55296) << 10) + 65536
      }
    },
    Dt = { codeAt: At(!1), charAt: At(!0) },
    Nt = !o(function() {
      function e() {}
      return (e.prototype.constructor = null), Object.getPrototypeOf(new e()) !== e.prototype
    }),
    Rt = H('IE_PROTO'),
    Lt = Object.prototype,
    Pt = Nt
      ? Object.getPrototypeOf
      : function(e) {
          return (
            (e = Pe(e)),
            v(e, Rt)
              ? e[Rt]
              : 'function' == typeof e.constructor && e instanceof e.constructor
              ? e.constructor.prototype
              : e instanceof Object
              ? Lt
              : null
          )
        },
    kt = Fe('iterator'),
    Gt = !1
  ;[].keys &&
    ('next' in (Ot = [].keys()) ? (Mt = Pt(Pt(Ot))) !== Object.prototype && (Tt = Mt) : (Gt = !0)),
    null == Tt && (Tt = {}),
    v(Tt, kt) ||
      N(Tt, kt, function() {
        return this
      })
  var wt = { IteratorPrototype: Tt, BUGGY_SAFARI_ITERATORS: Gt },
    bt = D.f,
    Ut = Fe('toStringTag'),
    xt = function(e, t, n) {
      e && !v((e = n ? e : e.prototype), Ut) && bt(e, Ut, { configurable: !0, value: t })
    },
    Ft = wt.IteratorPrototype,
    qt = function() {
      return this
    },
    Vt = function(e, t, n) {
      var r = t + ' Iterator'
      return (e.prototype = It(Ft, { next: c(1, n) })), xt(e, r, !1), (ze[r] = qt), e
    },
    Kt =
      Object.setPrototypeOf ||
      ('__proto__' in {}
        ? (function() {
            var e,
              t = !1,
              n = {}
            try {
              ;(e = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set).call(n, []),
                (t = n instanceof Array)
            } catch (kd) {}
            return function(n, r) {
              return (
                O(n),
                (function(e) {
                  if (!m(e) && null !== e)
                    throw TypeError("Can't set " + String(e) + ' as a prototype')
                })(r),
                t ? e.call(n, r) : (n.__proto__ = r),
                n
              )
            }
          })()
        : void 0),
    Bt = wt.IteratorPrototype,
    Ht = wt.BUGGY_SAFARI_ITERATORS,
    jt = Fe('iterator'),
    Yt = function() {
      return this
    },
    $t = function(e, t, n, r, o, i, a) {
      Vt(n, t, r)
      var s,
        u,
        c,
        l = function(e) {
          if (e === o && d) return d
          if (!Ht && e in f) return f[e]
          switch (e) {
            case 'keys':
            case 'values':
            case 'entries':
              return function() {
                return new n(this, e)
              }
          }
          return function() {
            return new n(this)
          }
        },
        p = t + ' Iterator',
        h = !1,
        f = e.prototype,
        g = f[jt] || f['@@iterator'] || (o && f[o]),
        d = (!Ht && g) || l(o),
        m = ('Array' == t && f.entries) || g
      if (
        (m &&
          ((s = Pt(m.call(new e()))),
          Bt !== Object.prototype &&
            s.next &&
            (Pt(s) !== Bt && (Kt ? Kt(s, Bt) : 'function' != typeof s[jt] && N(s, jt, Yt)),
            xt(s, p, !0))),
        'values' == o &&
          g &&
          'values' !== g.name &&
          ((h = !0),
          (d = function() {
            return g.call(this)
          })),
        f[jt] !== d && N(f, jt, d),
        (ze[t] = d),
        o)
      )
        if (((u = { values: l('values'), keys: i ? d : l('keys'), entries: l('entries') }), a))
          for (c in u) (!Ht && !h && c in f) || Z(f, c, u[c])
        else Ne({ target: t, proto: !0, forced: Ht || h }, u)
      return u
    },
    Wt = Dt.charAt,
    zt = Q.set,
    Xt = Q.getterFor('String Iterator')
  $t(
    String,
    'String',
    function(e) {
      zt(this, { type: 'String Iterator', string: String(e), index: 0 })
    },
    function() {
      var e,
        t = Xt(this),
        n = t.string,
        r = t.index
      return r >= n.length
        ? { value: void 0, done: !0 }
        : ((e = Wt(n, r)), (t.index += e.length), { value: e, done: !1 })
    }
  )
  var Jt = {
    CSSRuleList: 0,
    CSSStyleDeclaration: 0,
    CSSValueList: 0,
    ClientRectList: 0,
    DOMRectList: 0,
    DOMStringList: 0,
    DOMTokenList: 1,
    DataTransferItemList: 0,
    FileList: 0,
    HTMLAllCollection: 0,
    HTMLCollection: 0,
    HTMLFormElement: 0,
    HTMLSelectElement: 0,
    MediaList: 0,
    MimeTypeArray: 0,
    NamedNodeMap: 0,
    NodeList: 1,
    PaintRequestList: 0,
    Plugin: 0,
    PluginArray: 0,
    SVGLengthList: 0,
    SVGNumberList: 0,
    SVGPathSegList: 0,
    SVGPointList: 0,
    SVGStringList: 0,
    SVGTransformList: 0,
    SourceBufferList: 0,
    StyleSheetList: 0,
    TextTrackCueList: 0,
    TextTrackList: 0,
    TouchList: 0
  }
  for (var Qt in Jt) {
    var Zt = r[Qt],
      en = Zt && Zt.prototype
    if (en && en.forEach !== $e)
      try {
        N(en, 'forEach', $e)
      } catch (kd) {
        en.forEach = $e
      }
  }
  var tn,
    nn,
    rn = '2.4.1',
    on = {
      SDK_READY: 'sdkStateReady',
      SDK_NOT_READY: 'sdkStateNotReady',
      SDK_DESTROY: 'sdkDestroy',
      MESSAGE_RECEIVED: 'onMessageReceived',
      MESSAGE_REVOKED: 'onMessageRevoked',
      CONVERSATION_LIST_UPDATED: 'onConversationListUpdated',
      GROUP_LIST_UPDATED: 'onGroupListUpdated',
      GROUP_SYSTEM_NOTICE_RECEIVED: 'receiveGroupSystemNotice',
      PROFILE_UPDATED: 'onProfileUpdated',
      BLACKLIST_UPDATED: 'blacklistUpdated',
      KICKED_OUT: 'kickedOut',
      ERROR: 'error'
    },
    an = {
      MSG_TEXT: 'TIMTextElem',
      MSG_IMAGE: 'TIMImageElem',
      MSG_SOUND: 'TIMSoundElem',
      MSG_AUDIO: 'TIMSoundElem',
      MSG_FILE: 'TIMFileElem',
      MSG_FACE: 'TIMFaceElem',
      MSG_VIDEO: 'TIMVideoFileElem',
      MSG_GEO: 'TIMLocationElem',
      MSG_GRP_TIP: 'TIMGroupTipElem',
      MSG_GRP_SYS_NOTICE: 'TIMGroupSystemNoticeElem',
      MSG_CUSTOM: 'TIMCustomElem',
      CONV_C2C: 'C2C',
      CONV_GROUP: 'GROUP',
      CONV_SYSTEM: '@TIM#SYSTEM',
      GRP_PRIVATE: 'Private',
      GRP_PUBLIC: 'Public',
      GRP_CHATROOM: 'ChatRoom',
      GRP_AVCHATROOM: 'AVChatRoom',
      GRP_MBR_ROLE_OWNER: 'Owner',
      GRP_MBR_ROLE_ADMIN: 'Admin',
      GRP_MBR_ROLE_MEMBER: 'Member',
      GRP_TIP_MBR_JOIN: 1,
      GRP_TIP_MBR_QUIT: 2,
      GRP_TIP_MBR_KICKED_OUT: 3,
      GRP_TIP_MBR_SET_ADMIN: 4,
      GRP_TIP_MBR_CANCELED_ADMIN: 5,
      GRP_TIP_GRP_PROFILE_UPDATED: 6,
      GRP_TIP_MBR_PROFILE_UPDATED: 7,
      MSG_REMIND_ACPT_AND_NOTE: 'AcceptAndNotify',
      MSG_REMIND_ACPT_NOT_NOTE: 'AcceptNotNotify',
      MSG_REMIND_DISCARD: 'Discard',
      GENDER_UNKNOWN: 'Gender_Type_Unknown',
      GENDER_FEMALE: 'Gender_Type_Female',
      GENDER_MALE: 'Gender_Type_Male',
      KICKED_OUT_MULT_ACCOUNT: 'mutipleAccount',
      KICKED_OUT_MULT_DEVICE: 'mutipleDevice',
      KICKED_OUT_USERSIG_EXPIRED: 'userSigExpired',
      ALLOW_TYPE_ALLOW_ANY: 'AllowType_Type_AllowAny',
      ALLOW_TYPE_NEED_CONFIRM: 'AllowType_Type_NeedConfirm',
      ALLOW_TYPE_DENY_ANY: 'AllowType_Type_DenyAny',
      FORBID_TYPE_NONE: 'AdminForbid_Type_None',
      FORBID_TYPE_SEND_OUT: 'AdminForbid_Type_SendOut',
      JOIN_OPTIONS_FREE_ACCESS: 'FreeAccess',
      JOIN_OPTIONS_NEED_PERMISSION: 'NeedPermission',
      JOIN_OPTIONS_DISABLE_APPLY: 'DisableApply',
      JOIN_STATUS_SUCCESS: 'JoinedSuccess',
      JOIN_STATUS_ALREADY_IN_GROUP: 'AlreadyInGroup',
      JOIN_STATUS_WAIT_APPROVAL: 'WaitAdminApproval',
      GRP_PROFILE_OWNER_ID: 'ownerID',
      GRP_PROFILE_CREATE_TIME: 'createTime',
      GRP_PROFILE_LAST_INFO_TIME: 'lastInfoTime',
      GRP_PROFILE_MEMBER_NUM: 'memberNum',
      GRP_PROFILE_MAX_MEMBER_NUM: 'maxMemberNum',
      GRP_PROFILE_JOIN_OPTION: 'joinOption',
      GRP_PROFILE_INTRODUCTION: 'introduction',
      GRP_PROFILE_NOTIFICATION: 'notification'
    },
    sn = ne('navigator', 'userAgent') || '',
    un = r.process,
    cn = un && un.versions,
    ln = cn && cn.v8
  ln
    ? (nn = (tn = ln.split('.'))[0] + tn[1])
    : sn &&
      (!(tn = sn.match(/Edge\/(\d+)/)) || tn[1] >= 74) &&
      (tn = sn.match(/Chrome\/(\d+)/)) &&
      (nn = tn[1])
  var pn = nn && +nn,
    hn = Fe('species'),
    fn = function(e) {
      return (
        pn >= 51 ||
        !o(function() {
          var t = []
          return (
            ((t.constructor = {})[hn] = function() {
              return { foo: 1 }
            }),
            1 !== t[e](Boolean).foo
          )
        })
      )
    },
    gn = He.map,
    dn = fn('map'),
    mn =
      dn &&
      !o(function() {
        ;[].map.call({ length: -1, 0: 1 }, function(e) {
          throw e
        })
      })
  Ne(
    { target: 'Array', proto: !0, forced: !dn || !mn },
    {
      map: function(e) {
        return gn(this, e, arguments.length > 1 ? arguments[1] : void 0)
      }
    }
  )
  var _n = [].slice,
    yn = {},
    vn = function(e, t, n) {
      if (!(t in yn)) {
        for (var r = [], o = 0; o < t; o++) r[o] = 'a[' + o + ']'
        yn[t] = Function('C,a', 'return new C(' + r.join(',') + ')')
      }
      return yn[t](e, n)
    },
    En =
      Function.bind ||
      function(e) {
        var t = Re(this),
          n = _n.call(arguments, 1),
          r = function() {
            var o = n.concat(_n.call(arguments))
            return this instanceof r ? vn(t, o.length, o) : t.apply(e, o)
          }
        return m(t.prototype) && (r.prototype = t.prototype), r
      }
  function Sn(e) {
    return (Sn =
      'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
        ? function(e) {
            return typeof e
          }
        : function(e) {
            return e &&
              'function' == typeof Symbol &&
              e.constructor === Symbol &&
              e !== Symbol.prototype
              ? 'symbol'
              : typeof e
          })(e)
  }
  function In(e, t) {
    if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
  }
  function Cn(e, t) {
    for (var n = 0; n < t.length; n++) {
      var r = t[n]
      ;(r.enumerable = r.enumerable || !1),
        (r.configurable = !0),
        'value' in r && (r.writable = !0),
        Object.defineProperty(e, r.key, r)
    }
  }
  function Tn(e, t, n) {
    return t && Cn(e.prototype, t), n && Cn(e, n), e
  }
  function Mn(e, t, n) {
    return (
      t in e
        ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 })
        : (e[t] = n),
      e
    )
  }
  function On(e, t) {
    var n = Object.keys(e)
    if (Object.getOwnPropertySymbols) {
      var r = Object.getOwnPropertySymbols(e)
      t &&
        (r = r.filter(function(t) {
          return Object.getOwnPropertyDescriptor(e, t).enumerable
        })),
        n.push.apply(n, r)
    }
    return n
  }
  function An(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = null != arguments[t] ? arguments[t] : {}
      t % 2
        ? On(Object(n), !0).forEach(function(t) {
            Mn(e, t, n[t])
          })
        : Object.getOwnPropertyDescriptors
        ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
        : On(Object(n)).forEach(function(t) {
            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
          })
    }
    return e
  }
  function Dn(e, t) {
    if ('function' != typeof t && null !== t)
      throw new TypeError('Super expression must either be null or a function')
    ;(e.prototype = Object.create(t && t.prototype, {
      constructor: { value: e, writable: !0, configurable: !0 }
    })),
      t && Rn(e, t)
  }
  function Nn(e) {
    return (Nn = Object.setPrototypeOf
      ? Object.getPrototypeOf
      : function(e) {
          return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
  }
  function Rn(e, t) {
    return (Rn =
      Object.setPrototypeOf ||
      function(e, t) {
        return (e.__proto__ = t), e
      })(e, t)
  }
  function Ln(e, t, n) {
    return (Ln = (function() {
      if ('undefined' == typeof Reflect || !Reflect.construct) return !1
      if (Reflect.construct.sham) return !1
      if ('function' == typeof Proxy) return !0
      try {
        return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})), !0
      } catch (e) {
        return !1
      }
    })()
      ? Reflect.construct
      : function(e, t, n) {
          var r = [null]
          r.push.apply(r, t)
          var o = new (Function.bind.apply(e, r))()
          return n && Rn(o, n.prototype), o
        }).apply(null, arguments)
  }
  function Pn(e) {
    var t = 'function' == typeof Map ? new Map() : void 0
    return (Pn = function(e) {
      if (null === e || ((n = e), -1 === Function.toString.call(n).indexOf('[native code]')))
        return e
      var n
      if ('function' != typeof e)
        throw new TypeError('Super expression must either be null or a function')
      if (void 0 !== t) {
        if (t.has(e)) return t.get(e)
        t.set(e, r)
      }
      function r() {
        return Ln(e, arguments, Nn(this).constructor)
      }
      return (
        (r.prototype = Object.create(e.prototype, {
          constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 }
        })),
        Rn(r, e)
      )
    })(e)
  }
  function kn(e) {
    if (void 0 === e)
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
    return e
  }
  function Gn(e, t) {
    return !t || ('object' != typeof t && 'function' != typeof t) ? kn(e) : t
  }
  function wn(e, t) {
    return (
      (function(e) {
        if (Array.isArray(e)) return e
      })(e) ||
      (function(e, t) {
        if (
          !(
            Symbol.iterator in Object(e) ||
            '[object Arguments]' === Object.prototype.toString.call(e)
          )
        )
          return
        var n = [],
          r = !0,
          o = !1,
          i = void 0
        try {
          for (
            var a, s = e[Symbol.iterator]();
            !(r = (a = s.next()).done) && (n.push(a.value), !t || n.length !== t);
            r = !0
          );
        } catch (u) {
          ;(o = !0), (i = u)
        } finally {
          try {
            r || null == s.return || s.return()
          } finally {
            if (o) throw i
          }
        }
        return n
      })(e, t) ||
      (function() {
        throw new TypeError('Invalid attempt to destructure non-iterable instance')
      })()
    )
  }
  function bn(e) {
    return (
      (function(e) {
        if (Array.isArray(e)) {
          for (var t = 0, n = new Array(e.length); t < e.length; t++) n[t] = e[t]
          return n
        }
      })(e) ||
      (function(e) {
        if (
          Symbol.iterator in Object(e) ||
          '[object Arguments]' === Object.prototype.toString.call(e)
        )
          return Array.from(e)
      })(e) ||
      (function() {
        throw new TypeError('Invalid attempt to spread non-iterable instance')
      })()
    )
  }
  Ne({ target: 'Function', proto: !0 }, { bind: En })
  var Un = (function() {
      function e() {
        In(this, e), (this.cache = []), (this.options = null)
      }
      return (
        Tn(e, [
          {
            key: 'use',
            value: function(e) {
              if ('function' != typeof e) throw 'middleware must be a function'
              return this.cache.push(e), this
            }
          },
          {
            key: 'next',
            value: function(e) {
              if (this.middlewares && this.middlewares.length > 0)
                return this.middlewares.shift().call(this, this.options, this.next.bind(this))
            }
          },
          {
            key: 'run',
            value: function(e) {
              return (
                (this.middlewares = this.cache.map(function(e) {
                  return e
                })),
                (this.options = e),
                this.next()
              )
            }
          }
        ]),
        e
      )
    })(),
    xn = Fe('isConcatSpreadable'),
    Fn =
      pn >= 51 ||
      !o(function() {
        var e = []
        return (e[xn] = !1), e.concat()[0] !== e
      }),
    qn = fn('concat'),
    Vn = function(e) {
      if (!m(e)) return !1
      var t = e[xn]
      return void 0 !== t ? !!t : ke(e)
    }
  Ne(
    { target: 'Array', proto: !0, forced: !Fn || !qn },
    {
      concat: function(e) {
        var t,
          n,
          r,
          o,
          i,
          a = Pe(this),
          s = Ve(a, 0),
          u = 0
        for (t = -1, r = arguments.length; t < r; t++)
          if (((i = -1 === t ? a : arguments[t]), Vn(i))) {
            if (u + (o = se(i.length)) > 9007199254740991)
              throw TypeError('Maximum allowed index exceeded')
            for (n = 0; n < o; n++, u++) n in i && Ze(s, u, i[n])
          } else {
            if (u >= 9007199254740991) throw TypeError('Maximum allowed index exceeded')
            Ze(s, u++, i)
          }
        return (s.length = u), s
      }
    }
  )
  var Kn = D.f,
    Bn = Function.prototype,
    Hn = Bn.toString,
    jn = /^\s*function ([^ (]*)/
  !i ||
    'name' in Bn ||
    Kn(Bn, 'name', {
      configurable: !0,
      get: function() {
        try {
          return Hn.call(this).match(jn)[1]
        } catch (kd) {
          return ''
        }
      }
    })
  var Yn = t(function(t, n) {
    var r, o, i, a, s, u, c, l, p, h, f, g, d, m, _, y, v, E, S, I
    t.exports =
      ((r = 'function' == typeof Promise),
      (o = 'object' == typeof self ? self : e),
      (i = 'undefined' != typeof Symbol),
      (a = 'undefined' != typeof Map),
      (s = 'undefined' != typeof Set),
      (u = 'undefined' != typeof WeakMap),
      (c = 'undefined' != typeof WeakSet),
      (l = 'undefined' != typeof DataView),
      (p = i && void 0 !== Symbol.iterator),
      (h = i && void 0 !== Symbol.toStringTag),
      (f = s && 'function' == typeof Set.prototype.entries),
      (g = a && 'function' == typeof Map.prototype.entries),
      (d = f && Object.getPrototypeOf(new Set().entries())),
      (m = g && Object.getPrototypeOf(new Map().entries())),
      (_ = p && 'function' == typeof Array.prototype[Symbol.iterator]),
      (y = _ && Object.getPrototypeOf([][Symbol.iterator]())),
      (v = p && 'function' == typeof String.prototype[Symbol.iterator]),
      (E = v && Object.getPrototypeOf(''[Symbol.iterator]())),
      (S = 8),
      (I = -1),
      function(e) {
        var t = typeof e
        if ('object' !== t) return t
        if (null === e) return 'null'
        if (e === o) return 'global'
        if (Array.isArray(e) && (!1 === h || !(Symbol.toStringTag in e))) return 'Array'
        if ('object' == typeof window && null !== window) {
          if ('object' == typeof window.location && e === window.location) return 'Location'
          if ('object' == typeof window.document && e === window.document) return 'Document'
          if ('object' == typeof window.navigator) {
            if ('object' == typeof window.navigator.mimeTypes && e === window.navigator.mimeTypes)
              return 'MimeTypeArray'
            if ('object' == typeof window.navigator.plugins && e === window.navigator.plugins)
              return 'PluginArray'
          }
          if (
            ('function' == typeof window.HTMLElement || 'object' == typeof window.HTMLElement) &&
            e instanceof window.HTMLElement
          ) {
            if ('BLOCKQUOTE' === e.tagName) return 'HTMLQuoteElement'
            if ('TD' === e.tagName) return 'HTMLTableDataCellElement'
            if ('TH' === e.tagName) return 'HTMLTableHeaderCellElement'
          }
        }
        var n = h && e[Symbol.toStringTag]
        if ('string' == typeof n) return n
        var i = Object.getPrototypeOf(e)
        return i === RegExp.prototype
          ? 'RegExp'
          : i === Date.prototype
          ? 'Date'
          : r && i === Promise.prototype
          ? 'Promise'
          : s && i === Set.prototype
          ? 'Set'
          : a && i === Map.prototype
          ? 'Map'
          : c && i === WeakSet.prototype
          ? 'WeakSet'
          : u && i === WeakMap.prototype
          ? 'WeakMap'
          : l && i === DataView.prototype
          ? 'DataView'
          : a && i === m
          ? 'Map Iterator'
          : s && i === d
          ? 'Set Iterator'
          : _ && i === y
          ? 'Array Iterator'
          : v && i === E
          ? 'String Iterator'
          : null === i
          ? 'Object'
          : Object.prototype.toString.call(e).slice(S, I)
      })
  })
  Ne({ target: 'Array', stat: !0 }, { isArray: ke })
  var $n = _e.f,
    Wn = {}.toString,
    zn =
      'object' == typeof window && window && Object.getOwnPropertyNames
        ? Object.getOwnPropertyNames(window)
        : [],
    Xn = {
      f: function(e) {
        return zn && '[object Window]' == Wn.call(e)
          ? (function(e) {
              try {
                return $n(e)
              } catch (kd) {
                return zn.slice()
              }
            })(e)
          : $n(d(e))
      }
    },
    Jn = { f: Fe },
    Qn = D.f,
    Zn = function(e) {
      var t = ee.Symbol || (ee.Symbol = {})
      v(t, e) || Qn(t, e, { value: Jn.f(e) })
    },
    er = He.forEach,
    tr = H('hidden'),
    nr = Fe('toPrimitive'),
    rr = Q.set,
    or = Q.getterFor('Symbol'),
    ir = Object.prototype,
    ar = r.Symbol,
    sr = ne('JSON', 'stringify'),
    ur = M.f,
    cr = D.f,
    lr = Xn.f,
    pr = u.f,
    hr = F('symbols'),
    fr = F('op-symbols'),
    gr = F('string-to-symbol-registry'),
    dr = F('symbol-to-string-registry'),
    mr = F('wks'),
    _r = r.QObject,
    yr = !_r || !_r.prototype || !_r.prototype.findChild,
    vr =
      i &&
      o(function() {
        return (
          7 !=
          It(
            cr({}, 'a', {
              get: function() {
                return cr(this, 'a', { value: 7 }).a
              }
            })
          ).a
        )
      })
        ? function(e, t, n) {
            var r = ur(ir, t)
            r && delete ir[t], cr(e, t, n), r && e !== ir && cr(ir, t, r)
          }
        : cr,
    Er = function(e, t) {
      var n = (hr[e] = It(ar.prototype))
      return rr(n, { type: 'Symbol', tag: e, description: t }), i || (n.description = t), n
    },
    Sr = we
      ? function(e) {
          return 'symbol' == typeof e
        }
      : function(e) {
          return Object(e) instanceof ar
        },
    Ir = function(e, t, n) {
      e === ir && Ir(fr, t, n), O(e)
      var r = _(t, !0)
      return (
        O(n),
        v(hr, r)
          ? (n.enumerable
              ? (v(e, tr) && e[tr][r] && (e[tr][r] = !1), (n = It(n, { enumerable: c(0, !1) })))
              : (v(e, tr) || cr(e, tr, c(1, {})), (e[tr][r] = !0)),
            vr(e, r, n))
          : cr(e, r, n)
      )
    },
    Cr = function(e, t) {
      O(e)
      var n = d(t),
        r = dt(n).concat(Ar(n))
      return (
        er(r, function(t) {
          ;(i && !Tr.call(n, t)) || Ir(e, t, n[t])
        }),
        e
      )
    },
    Tr = function(e) {
      var t = _(e, !0),
        n = pr.call(this, t)
      return (
        !(this === ir && v(hr, t) && !v(fr, t)) &&
        (!(n || !v(this, t) || !v(hr, t) || (v(this, tr) && this[tr][t])) || n)
      )
    },
    Mr = function(e, t) {
      var n = d(e),
        r = _(t, !0)
      if (n !== ir || !v(hr, r) || v(fr, r)) {
        var o = ur(n, r)
        return !o || !v(hr, r) || (v(n, tr) && n[tr][r]) || (o.enumerable = !0), o
      }
    },
    Or = function(e) {
      var t = lr(d(e)),
        n = []
      return (
        er(t, function(e) {
          v(hr, e) || v(j, e) || n.push(e)
        }),
        n
      )
    },
    Ar = function(e) {
      var t = e === ir,
        n = lr(t ? fr : d(e)),
        r = []
      return (
        er(n, function(e) {
          !v(hr, e) || (t && !v(ir, e)) || r.push(hr[e])
        }),
        r
      )
    }
  if (
    (Ge ||
      (Z(
        (ar = function() {
          if (this instanceof ar) throw TypeError('Symbol is not a constructor')
          var e = arguments.length && void 0 !== arguments[0] ? String(arguments[0]) : void 0,
            t = K(e),
            n = function(e) {
              this === ir && n.call(fr, e),
                v(this, tr) && v(this[tr], t) && (this[tr][t] = !1),
                vr(this, t, c(1, e))
            }
          return i && yr && vr(ir, t, { configurable: !0, set: n }), Er(t, e)
        }).prototype,
        'toString',
        function() {
          return or(this).tag
        }
      ),
      Z(ar, 'withoutSetter', function(e) {
        return Er(K(e), e)
      }),
      (u.f = Tr),
      (D.f = Ir),
      (M.f = Mr),
      (_e.f = Xn.f = Or),
      (ye.f = Ar),
      (Jn.f = function(e) {
        return Er(Fe(e), e)
      }),
      i &&
        (cr(ar.prototype, 'description', {
          configurable: !0,
          get: function() {
            return or(this).description
          }
        }),
        Z(ir, 'propertyIsEnumerable', Tr, { unsafe: !0 }))),
    Ne({ global: !0, wrap: !0, forced: !Ge, sham: !Ge }, { Symbol: ar }),
    er(dt(mr), function(e) {
      Zn(e)
    }),
    Ne(
      { target: 'Symbol', stat: !0, forced: !Ge },
      {
        for: function(e) {
          var t = String(e)
          if (v(gr, t)) return gr[t]
          var n = ar(t)
          return (gr[t] = n), (dr[n] = t), n
        },
        keyFor: function(e) {
          if (!Sr(e)) throw TypeError(e + ' is not a symbol')
          if (v(dr, e)) return dr[e]
        },
        useSetter: function() {
          yr = !0
        },
        useSimple: function() {
          yr = !1
        }
      }
    ),
    Ne(
      { target: 'Object', stat: !0, forced: !Ge, sham: !i },
      {
        create: function(e, t) {
          return void 0 === t ? It(e) : Cr(It(e), t)
        },
        defineProperty: Ir,
        defineProperties: Cr,
        getOwnPropertyDescriptor: Mr
      }
    ),
    Ne(
      { target: 'Object', stat: !0, forced: !Ge },
      { getOwnPropertyNames: Or, getOwnPropertySymbols: Ar }
    ),
    Ne(
      {
        target: 'Object',
        stat: !0,
        forced: o(function() {
          ye.f(1)
        })
      },
      {
        getOwnPropertySymbols: function(e) {
          return ye.f(Pe(e))
        }
      }
    ),
    sr)
  ) {
    var Dr =
      !Ge ||
      o(function() {
        var e = ar()
        return '[null]' != sr([e]) || '{}' != sr({ a: e }) || '{}' != sr(Object(e))
      })
    Ne(
      { target: 'JSON', stat: !0, forced: Dr },
      {
        stringify: function(e, t, n) {
          for (var r, o = [e], i = 1; arguments.length > i; ) o.push(arguments[i++])
          if (((r = t), (m(t) || void 0 !== e) && !Sr(e)))
            return (
              ke(t) ||
                (t = function(e, t) {
                  if (('function' == typeof r && (t = r.call(this, e, t)), !Sr(t))) return t
                }),
              (o[1] = t),
              sr.apply(null, o)
            )
        }
      }
    )
  }
  ar.prototype[nr] || N(ar.prototype, nr, ar.prototype.valueOf), xt(ar, 'Symbol'), (j[tr] = !0)
  var Nr = D.f,
    Rr = r.Symbol
  if (
    i &&
    'function' == typeof Rr &&
    (!('description' in Rr.prototype) || void 0 !== Rr().description)
  ) {
    var Lr = {},
      Pr = function() {
        var e = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0]),
          t = this instanceof Pr ? new Rr(e) : void 0 === e ? Rr() : Rr(e)
        return '' === e && (Lr[t] = !0), t
      }
    Ee(Pr, Rr)
    var kr = (Pr.prototype = Rr.prototype)
    kr.constructor = Pr
    var Gr = kr.toString,
      wr = 'Symbol(test)' == String(Rr('test')),
      br = /^Symbol\((.*)\)[^)]+$/
    Nr(kr, 'description', {
      configurable: !0,
      get: function() {
        var e = m(this) ? this.valueOf() : this,
          t = Gr.call(e)
        if (v(Lr, e)) return ''
        var n = wr ? t.slice(7, -1) : t.replace(br, '$1')
        return '' === n ? void 0 : n
      }
    }),
      Ne({ global: !0, forced: !0 }, { Symbol: Pr })
  }
  Zn('iterator')
  var Ur = Fe('unscopables'),
    xr = Array.prototype
  null == xr[Ur] && D.f(xr, Ur, { configurable: !0, value: It(null) })
  var Fr = function(e) {
      xr[Ur][e] = !0
    },
    qr = He.find,
    Vr = !0
  'find' in [] &&
    Array(1).find(function() {
      Vr = !1
    }),
    Ne(
      { target: 'Array', proto: !0, forced: Vr },
      {
        find: function(e) {
          return qr(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
      }
    ),
    Fr('find')
  var Kr = he.includes
  Ne(
    { target: 'Array', proto: !0 },
    {
      includes: function(e) {
        return Kr(this, e, arguments.length > 1 ? arguments[1] : void 0)
      }
    }
  ),
    Fr('includes')
  var Br = he.indexOf,
    Hr = [].indexOf,
    jr = !!Hr && 1 / [1].indexOf(1, -0) < 0,
    Yr = je('indexOf')
  Ne(
    { target: 'Array', proto: !0, forced: jr || Yr },
    {
      indexOf: function(e) {
        return jr
          ? Hr.apply(this, arguments) || 0
          : Br(this, e, arguments.length > 1 ? arguments[1] : void 0)
      }
    }
  )
  var $r = Q.set,
    Wr = Q.getterFor('Array Iterator'),
    zr = $t(
      Array,
      'Array',
      function(e, t) {
        $r(this, { type: 'Array Iterator', target: d(e), index: 0, kind: t })
      },
      function() {
        var e = Wr(this),
          t = e.target,
          n = e.kind,
          r = e.index++
        return !t || r >= t.length
          ? ((e.target = void 0), { value: void 0, done: !0 })
          : 'keys' == n
          ? { value: r, done: !1 }
          : 'values' == n
          ? { value: t[r], done: !1 }
          : { value: [r, t[r]], done: !1 }
      },
      'values'
    )
  ;(ze.Arguments = ze.Array), Fr('keys'), Fr('values'), Fr('entries')
  var Xr = [].join,
    Jr = f != Object,
    Qr = je('join', ',')
  Ne(
    { target: 'Array', proto: !0, forced: Jr || Qr },
    {
      join: function(e) {
        return Xr.call(d(this), void 0 === e ? ',' : e)
      }
    }
  )
  var Zr = Fe('species'),
    eo = [].slice,
    to = Math.max
  Ne(
    { target: 'Array', proto: !0, forced: !fn('slice') },
    {
      slice: function(e, t) {
        var n,
          r,
          o,
          i = d(this),
          a = se(i.length),
          s = le(e, a),
          u = le(void 0 === t ? a : t, a)
        if (
          ke(i) &&
          ('function' != typeof (n = i.constructor) || (n !== Array && !ke(n.prototype))
            ? m(n) && null === (n = n[Zr]) && (n = void 0)
            : (n = void 0),
          n === Array || void 0 === n)
        )
          return eo.call(i, s, u)
        for (r = new (void 0 === n ? Array : n)(to(u - s, 0)), o = 0; s < u; s++, o++)
          s in i && Ze(r, o, i[s])
        return (r.length = o), r
      }
    }
  ),
    Ne(
      { target: 'Date', stat: !0 },
      {
        now: function() {
          return new Date().getTime()
        }
      }
    )
  var no =
      ''.repeat ||
      function(e) {
        var t = String(g(this)),
          n = '',
          r = ie(e)
        if (r < 0 || Infinity == r) throw RangeError('Wrong number of repetitions')
        for (; r > 0; (r >>>= 1) && (t += t)) 1 & r && (n += t)
        return n
      },
    ro = Math.ceil,
    oo = function(e) {
      return function(t, n, r) {
        var o,
          i,
          a = String(g(t)),
          s = a.length,
          u = void 0 === r ? ' ' : String(r),
          c = se(n)
        return c <= s || '' == u
          ? a
          : ((o = c - s),
            (i = no.call(u, ro(o / u.length))).length > o && (i = i.slice(0, o)),
            e ? a + i : i + a)
      }
    },
    io = { start: oo(!1), end: oo(!0) }.start,
    ao = Math.abs,
    so = Date.prototype,
    uo = so.getTime,
    co = so.toISOString,
    lo =
      o(function() {
        return '0385-07-25T07:06:39.999Z' != co.call(new Date(-5e13 - 1))
      }) ||
      !o(function() {
        co.call(new Date(NaN))
      })
        ? function() {
            if (!isFinite(uo.call(this))) throw RangeError('Invalid time value')
            var e = this.getUTCFullYear(),
              t = this.getUTCMilliseconds(),
              n = e < 0 ? '-' : e > 9999 ? '+' : ''
            return (
              n +
              io(ao(e), n ? 6 : 4, 0) +
              '-' +
              io(this.getUTCMonth() + 1, 2, 0) +
              '-' +
              io(this.getUTCDate(), 2, 0) +
              'T' +
              io(this.getUTCHours(), 2, 0) +
              ':' +
              io(this.getUTCMinutes(), 2, 0) +
              ':' +
              io(this.getUTCSeconds(), 2, 0) +
              '.' +
              io(t, 3, 0) +
              'Z'
            )
          }
        : co
  Ne({ target: 'Date', proto: !0, forced: Date.prototype.toISOString !== lo }, { toISOString: lo })
  var po = Date.prototype,
    ho = po.toString,
    fo = po.getTime
  new Date(NaN) + '' != 'Invalid Date' &&
    Z(po, 'toString', function() {
      var e = fo.call(this)
      return e == e ? ho.call(this) : 'Invalid Date'
    })
  var go = function(e, t, n) {
      var r, o
      return (
        Kt &&
          'function' == typeof (r = t.constructor) &&
          r !== n &&
          m((o = r.prototype)) &&
          o !== n.prototype &&
          Kt(e, o),
        e
      )
    },
    mo = '\t\n\v\f\r                　\u2028\u2029\ufeff',
    _o = '[' + mo + ']',
    yo = RegExp('^' + _o + _o + '*'),
    vo = RegExp(_o + _o + '*$'),
    Eo = function(e) {
      return function(t) {
        var n = String(g(t))
        return 1 & e && (n = n.replace(yo, '')), 2 & e && (n = n.replace(vo, '')), n
      }
    },
    So = { start: Eo(1), end: Eo(2), trim: Eo(3) },
    Io = _e.f,
    Co = M.f,
    To = D.f,
    Mo = So.trim,
    Oo = r.Number,
    Ao = Oo.prototype,
    Do = 'Number' == p(It(Ao)),
    No = function(e) {
      var t,
        n,
        r,
        o,
        i,
        a,
        s,
        u,
        c = _(e, !1)
      if ('string' == typeof c && c.length > 2)
        if (43 === (t = (c = Mo(c)).charCodeAt(0)) || 45 === t) {
          if (88 === (n = c.charCodeAt(2)) || 120 === n) return NaN
        } else if (48 === t) {
          switch (c.charCodeAt(1)) {
            case 66:
            case 98:
              ;(r = 2), (o = 49)
              break
            case 79:
            case 111:
              ;(r = 8), (o = 55)
              break
            default:
              return +c
          }
          for (a = (i = c.slice(2)).length, s = 0; s < a; s++)
            if ((u = i.charCodeAt(s)) < 48 || u > o) return NaN
          return parseInt(i, r)
        }
      return +c
    }
  if (Ae('Number', !Oo(' 0o1') || !Oo('0b1') || Oo('+0x1'))) {
    for (
      var Ro,
        Lo = function(e) {
          var t = arguments.length < 1 ? 0 : e,
            n = this
          return n instanceof Lo &&
            (Do
              ? o(function() {
                  Ao.valueOf.call(n)
                })
              : 'Number' != p(n))
            ? go(new Oo(No(t)), n, Lo)
            : No(t)
        },
        Po = i
          ? Io(Oo)
          : 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'.split(
              ','
            ),
        ko = 0;
      Po.length > ko;
      ko++
    )
      v(Oo, (Ro = Po[ko])) && !v(Lo, Ro) && To(Lo, Ro, Co(Oo, Ro))
    ;(Lo.prototype = Ao), (Ao.constructor = Lo), Z(r, 'Number', Lo)
  }
  var Go = Xn.f,
    wo = o(function() {
      return !Object.getOwnPropertyNames(1)
    })
  Ne({ target: 'Object', stat: !0, forced: wo }, { getOwnPropertyNames: Go })
  var bo = o(function() {
    Pt(1)
  })
  Ne(
    { target: 'Object', stat: !0, forced: bo, sham: !Nt },
    {
      getPrototypeOf: function(e) {
        return Pt(Pe(e))
      }
    }
  )
  var Uo = tt
    ? {}.toString
    : function() {
        return '[object ' + ot(this) + ']'
      }
  tt || Z(Object.prototype, 'toString', Uo, { unsafe: !0 })
  var xo = So.trim,
    Fo = r.parseInt,
    qo = /^[+-]?0[Xx]/,
    Vo =
      8 !== Fo(mo + '08') || 22 !== Fo(mo + '0x16')
        ? function(e, t) {
            var n = xo(String(e))
            return Fo(n, t >>> 0 || (qo.test(n) ? 16 : 10))
          }
        : Fo
  Ne({ global: !0, forced: parseInt != Vo }, { parseInt: Vo })
  var Ko,
    Bo,
    Ho,
    jo = r.Promise,
    Yo = function(e, t, n) {
      for (var r in t) Z(e, r, t[r], n)
      return e
    },
    $o = Fe('species'),
    Wo = function(e) {
      var t = ne(e),
        n = D.f
      i &&
        t &&
        !t[$o] &&
        n(t, $o, {
          configurable: !0,
          get: function() {
            return this
          }
        })
    },
    zo = function(e, t, n) {
      if (!(e instanceof t)) throw TypeError('Incorrect ' + (n ? n + ' ' : '') + 'invocation')
      return e
    },
    Xo = t(function(e) {
      var t = function(e, t) {
        ;(this.stopped = e), (this.result = t)
      }
      ;(e.exports = function(e, n, r, o, i) {
        var a,
          s,
          u,
          c,
          l,
          p,
          h,
          f = Le(n, r, o ? 2 : 1)
        if (i) a = e
        else {
          if ('function' != typeof (s = at(e))) throw TypeError('Target is not iterable')
          if (Qe(s)) {
            for (u = 0, c = se(e.length); c > u; u++)
              if ((l = o ? f(O((h = e[u]))[0], h[1]) : f(e[u])) && l instanceof t) return l
            return new t(!1)
          }
          a = s.call(e)
        }
        for (p = a.next; !(h = p.call(a)).done; )
          if ('object' == typeof (l = We(a, f, h.value, o)) && l && l instanceof t) return l
        return new t(!1)
      }).stop = function(e) {
        return new t(!0, e)
      }
    }),
    Jo = Fe('species'),
    Qo = function(e, t) {
      var n,
        r = O(e).constructor
      return void 0 === r || null == (n = O(r)[Jo]) ? t : Re(n)
    },
    Zo = /(iphone|ipod|ipad).*applewebkit/i.test(sn),
    ei = r.location,
    ti = r.setImmediate,
    ni = r.clearImmediate,
    ri = r.process,
    oi = r.MessageChannel,
    ii = r.Dispatch,
    ai = 0,
    si = {},
    ui = function(e) {
      if (si.hasOwnProperty(e)) {
        var t = si[e]
        delete si[e], t()
      }
    },
    ci = function(e) {
      return function() {
        ui(e)
      }
    },
    li = function(e) {
      ui(e.data)
    },
    pi = function(e) {
      r.postMessage(e + '', ei.protocol + '//' + ei.host)
    }
  ;(ti && ni) ||
    ((ti = function(e) {
      for (var t = [], n = 1; arguments.length > n; ) t.push(arguments[n++])
      return (
        (si[++ai] = function() {
          ;('function' == typeof e ? e : Function(e)).apply(void 0, t)
        }),
        Ko(ai),
        ai
      )
    }),
    (ni = function(e) {
      delete si[e]
    }),
    'process' == p(ri)
      ? (Ko = function(e) {
          ri.nextTick(ci(e))
        })
      : ii && ii.now
      ? (Ko = function(e) {
          ii.now(ci(e))
        })
      : oi && !Zo
      ? ((Ho = (Bo = new oi()).port2), (Bo.port1.onmessage = li), (Ko = Le(Ho.postMessage, Ho, 1)))
      : !r.addEventListener || 'function' != typeof postMessage || r.importScripts || o(pi)
      ? (Ko =
          'onreadystatechange' in I('script')
            ? function(e) {
                _t.appendChild(I('script')).onreadystatechange = function() {
                  _t.removeChild(this), ui(e)
                }
              }
            : function(e) {
                setTimeout(ci(e), 0)
              })
      : ((Ko = pi), r.addEventListener('message', li, !1)))
  var hi,
    fi,
    gi,
    di,
    mi,
    _i,
    yi,
    vi,
    Ei = { set: ti, clear: ni },
    Si = M.f,
    Ii = Ei.set,
    Ci = r.MutationObserver || r.WebKitMutationObserver,
    Ti = r.process,
    Mi = r.Promise,
    Oi = 'process' == p(Ti),
    Ai = Si(r, 'queueMicrotask'),
    Di = Ai && Ai.value
  Di ||
    ((hi = function() {
      var e, t
      for (Oi && (e = Ti.domain) && e.exit(); fi; ) {
        ;(t = fi.fn), (fi = fi.next)
        try {
          t()
        } catch (kd) {
          throw (fi ? di() : (gi = void 0), kd)
        }
      }
      ;(gi = void 0), e && e.enter()
    }),
    Oi
      ? (di = function() {
          Ti.nextTick(hi)
        })
      : Ci && !Zo
      ? ((mi = !0),
        (_i = document.createTextNode('')),
        new Ci(hi).observe(_i, { characterData: !0 }),
        (di = function() {
          _i.data = mi = !mi
        }))
      : Mi && Mi.resolve
      ? ((yi = Mi.resolve(void 0)),
        (vi = yi.then),
        (di = function() {
          vi.call(yi, hi)
        }))
      : (di = function() {
          Ii.call(r, hi)
        }))
  var Ni,
    Ri,
    Li,
    Pi,
    ki =
      Di ||
      function(e) {
        var t = { fn: e, next: void 0 }
        gi && (gi.next = t), fi || ((fi = t), di()), (gi = t)
      },
    Gi = function(e) {
      var t, n
      ;(this.promise = new e(function(e, r) {
        if (void 0 !== t || void 0 !== n) throw TypeError('Bad Promise constructor')
        ;(t = e), (n = r)
      })),
        (this.resolve = Re(t)),
        (this.reject = Re(n))
    },
    wi = {
      f: function(e) {
        return new Gi(e)
      }
    },
    bi = function(e, t) {
      if ((O(e), m(t) && t.constructor === e)) return t
      var n = wi.f(e)
      return (0, n.resolve)(t), n.promise
    },
    Ui = function(e) {
      try {
        return { error: !1, value: e() }
      } catch (kd) {
        return { error: !0, value: kd }
      }
    },
    xi = Ei.set,
    Fi = Fe('species'),
    qi = 'Promise',
    Vi = Q.get,
    Ki = Q.set,
    Bi = Q.getterFor(qi),
    Hi = jo,
    ji = r.TypeError,
    Yi = r.document,
    $i = r.process,
    Wi = ne('fetch'),
    zi = wi.f,
    Xi = zi,
    Ji = 'process' == p($i),
    Qi = !!(Yi && Yi.createEvent && r.dispatchEvent),
    Zi = Ae(qi, function() {
      if (!(b(Hi) !== String(Hi))) {
        if (66 === pn) return !0
        if (!Ji && 'function' != typeof PromiseRejectionEvent) return !0
      }
      if (pn >= 51 && /native code/.test(Hi)) return !1
      var e = Hi.resolve(1),
        t = function(e) {
          e(
            function() {},
            function() {}
          )
        }
      return ((e.constructor = {})[Fi] = t), !(e.then(function() {}) instanceof t)
    }),
    ea =
      Zi ||
      !ht(function(e) {
        Hi.all(e).catch(function() {})
      }),
    ta = function(e) {
      var t
      return !(!m(e) || 'function' != typeof (t = e.then)) && t
    },
    na = function(e, t, n) {
      if (!t.notified) {
        t.notified = !0
        var r = t.reactions
        ki(function() {
          for (var o = t.value, i = 1 == t.state, a = 0; r.length > a; ) {
            var s,
              u,
              c,
              l = r[a++],
              p = i ? l.ok : l.fail,
              h = l.resolve,
              f = l.reject,
              g = l.domain
            try {
              p
                ? (i || (2 === t.rejection && aa(e, t), (t.rejection = 1)),
                  !0 === p ? (s = o) : (g && g.enter(), (s = p(o)), g && (g.exit(), (c = !0))),
                  s === l.promise
                    ? f(ji('Promise-chain cycle'))
                    : (u = ta(s))
                    ? u.call(s, h, f)
                    : h(s))
                : f(o)
            } catch (kd) {
              g && !c && g.exit(), f(kd)
            }
          }
          ;(t.reactions = []), (t.notified = !1), n && !t.rejection && oa(e, t)
        })
      }
    },
    ra = function(e, t, n) {
      var o, i
      Qi
        ? (((o = Yi.createEvent('Event')).promise = t),
          (o.reason = n),
          o.initEvent(e, !1, !0),
          r.dispatchEvent(o))
        : (o = { promise: t, reason: n }),
        (i = r['on' + e])
          ? i(o)
          : 'unhandledrejection' === e &&
            (function(e, t) {
              var n = r.console
              n && n.error && (1 === arguments.length ? n.error(e) : n.error(e, t))
            })('Unhandled promise rejection', n)
    },
    oa = function(e, t) {
      xi.call(r, function() {
        var n,
          r = t.value
        if (
          ia(t) &&
          ((n = Ui(function() {
            Ji ? $i.emit('unhandledRejection', r, e) : ra('unhandledrejection', e, r)
          })),
          (t.rejection = Ji || ia(t) ? 2 : 1),
          n.error)
        )
          throw n.value
      })
    },
    ia = function(e) {
      return 1 !== e.rejection && !e.parent
    },
    aa = function(e, t) {
      xi.call(r, function() {
        Ji ? $i.emit('rejectionHandled', e) : ra('rejectionhandled', e, t.value)
      })
    },
    sa = function(e, t, n, r) {
      return function(o) {
        e(t, n, o, r)
      }
    },
    ua = function(e, t, n, r) {
      t.done || ((t.done = !0), r && (t = r), (t.value = n), (t.state = 2), na(e, t, !0))
    },
    ca = function(e, t, n, r) {
      if (!t.done) {
        ;(t.done = !0), r && (t = r)
        try {
          if (e === n) throw ji("Promise can't be resolved itself")
          var o = ta(n)
          o
            ? ki(function() {
                var r = { done: !1 }
                try {
                  o.call(n, sa(ca, e, r, t), sa(ua, e, r, t))
                } catch (kd) {
                  ua(e, r, kd, t)
                }
              })
            : ((t.value = n), (t.state = 1), na(e, t, !1))
        } catch (kd) {
          ua(e, { done: !1 }, kd, t)
        }
      }
    }
  Zi &&
    ((Hi = function(e) {
      zo(this, Hi, qi), Re(e), Ni.call(this)
      var t = Vi(this)
      try {
        e(sa(ca, this, t), sa(ua, this, t))
      } catch (kd) {
        ua(this, t, kd)
      }
    }),
    ((Ni = function(e) {
      Ki(this, {
        type: qi,
        done: !1,
        notified: !1,
        parent: !1,
        reactions: [],
        rejection: !1,
        state: 0,
        value: void 0
      })
    }).prototype = Yo(Hi.prototype, {
      then: function(e, t) {
        var n = Bi(this),
          r = zi(Qo(this, Hi))
        return (
          (r.ok = 'function' != typeof e || e),
          (r.fail = 'function' == typeof t && t),
          (r.domain = Ji ? $i.domain : void 0),
          (n.parent = !0),
          n.reactions.push(r),
          0 != n.state && na(this, n, !1),
          r.promise
        )
      },
      catch: function(e) {
        return this.then(void 0, e)
      }
    })),
    (Ri = function() {
      var e = new Ni(),
        t = Vi(e)
      ;(this.promise = e), (this.resolve = sa(ca, e, t)), (this.reject = sa(ua, e, t))
    }),
    (wi.f = zi = function(e) {
      return e === Hi || e === Li ? new Ri(e) : Xi(e)
    }),
    'function' == typeof jo &&
      ((Pi = jo.prototype.then),
      Z(
        jo.prototype,
        'then',
        function(e, t) {
          var n = this
          return new Hi(function(e, t) {
            Pi.call(n, e, t)
          }).then(e, t)
        },
        { unsafe: !0 }
      ),
      'function' == typeof Wi &&
        Ne(
          { global: !0, enumerable: !0, forced: !0 },
          {
            fetch: function(e) {
              return bi(Hi, Wi.apply(r, arguments))
            }
          }
        ))),
    Ne({ global: !0, wrap: !0, forced: Zi }, { Promise: Hi }),
    xt(Hi, qi, !1),
    Wo(qi),
    (Li = ne(qi)),
    Ne(
      { target: qi, stat: !0, forced: Zi },
      {
        reject: function(e) {
          var t = zi(this)
          return t.reject.call(void 0, e), t.promise
        }
      }
    ),
    Ne(
      { target: qi, stat: !0, forced: Zi },
      {
        resolve: function(e) {
          return bi(this, e)
        }
      }
    ),
    Ne(
      { target: qi, stat: !0, forced: ea },
      {
        all: function(e) {
          var t = this,
            n = zi(t),
            r = n.resolve,
            o = n.reject,
            i = Ui(function() {
              var n = Re(t.resolve),
                i = [],
                a = 0,
                s = 1
              Xo(e, function(e) {
                var u = a++,
                  c = !1
                i.push(void 0),
                  s++,
                  n.call(t, e).then(function(e) {
                    c || ((c = !0), (i[u] = e), --s || r(i))
                  }, o)
              }),
                --s || r(i)
            })
          return i.error && o(i.value), n.promise
        },
        race: function(e) {
          var t = this,
            n = zi(t),
            r = n.reject,
            o = Ui(function() {
              var o = Re(t.resolve)
              Xo(e, function(e) {
                o.call(t, e).then(n.resolve, r)
              })
            })
          return o.error && r(o.value), n.promise
        }
      }
    )
  var la = function() {
    var e = O(this),
      t = ''
    return (
      e.global && (t += 'g'),
      e.ignoreCase && (t += 'i'),
      e.multiline && (t += 'm'),
      e.dotAll && (t += 's'),
      e.unicode && (t += 'u'),
      e.sticky && (t += 'y'),
      t
    )
  }
  function pa(e, t) {
    return RegExp(e, t)
  }
  var ha,
    fa,
    ga = {
      UNSUPPORTED_Y: o(function() {
        var e = pa('a', 'y')
        return (e.lastIndex = 2), null != e.exec('abcd')
      }),
      BROKEN_CARET: o(function() {
        var e = pa('^r', 'gy')
        return (e.lastIndex = 2), null != e.exec('str')
      })
    },
    da = RegExp.prototype.exec,
    ma = String.prototype.replace,
    _a = da,
    ya =
      ((ha = /a/),
      (fa = /b*/g),
      da.call(ha, 'a'),
      da.call(fa, 'a'),
      0 !== ha.lastIndex || 0 !== fa.lastIndex),
    va = ga.UNSUPPORTED_Y || ga.BROKEN_CARET,
    Ea = void 0 !== /()??/.exec('')[1]
  ;(ya || Ea || va) &&
    (_a = function(e) {
      var t,
        n,
        r,
        o,
        i = this,
        a = va && i.sticky,
        s = la.call(i),
        u = i.source,
        c = 0,
        l = e
      return (
        a &&
          (-1 === (s = s.replace('y', '')).indexOf('g') && (s += 'g'),
          (l = String(e).slice(i.lastIndex)),
          i.lastIndex > 0 &&
            (!i.multiline || (i.multiline && '\n' !== e[i.lastIndex - 1])) &&
            ((u = '(?: ' + u + ')'), (l = ' ' + l), c++),
          (n = new RegExp('^(?:' + u + ')', s))),
        Ea && (n = new RegExp('^' + u + '$(?!\\s)', s)),
        ya && (t = i.lastIndex),
        (r = da.call(a ? n : i, l)),
        a
          ? r
            ? ((r.input = r.input.slice(c)),
              (r[0] = r[0].slice(c)),
              (r.index = i.lastIndex),
              (i.lastIndex += r[0].length))
            : (i.lastIndex = 0)
          : ya && r && (i.lastIndex = i.global ? r.index + r[0].length : t),
        Ea &&
          r &&
          r.length > 1 &&
          ma.call(r[0], n, function() {
            for (o = 1; o < arguments.length - 2; o++) void 0 === arguments[o] && (r[o] = void 0)
          }),
        r
      )
    })
  var Sa = _a
  Ne({ target: 'RegExp', proto: !0, forced: /./.exec !== Sa }, { exec: Sa })
  var Ia = RegExp.prototype,
    Ca = Ia.toString,
    Ta = o(function() {
      return '/a/b' != Ca.call({ source: 'a', flags: 'b' })
    }),
    Ma = 'toString' != Ca.name
  ;(Ta || Ma) &&
    Z(
      RegExp.prototype,
      'toString',
      function() {
        var e = O(this),
          t = String(e.source),
          n = e.flags
        return (
          '/' +
          t +
          '/' +
          String(void 0 === n && e instanceof RegExp && !('flags' in Ia) ? la.call(e) : n)
        )
      },
      { unsafe: !0 }
    )
  var Oa = Fe('match'),
    Aa = function(e) {
      var t
      return m(e) && (void 0 !== (t = e[Oa]) ? !!t : 'RegExp' == p(e))
    },
    Da = function(e) {
      if (Aa(e)) throw TypeError("The method doesn't accept regular expressions")
      return e
    },
    Na = Fe('match')
  Ne(
    {
      target: 'String',
      proto: !0,
      forced: !(function(e) {
        var t = /./
        try {
          '/./'[e](t)
        } catch (n) {
          try {
            return (t[Na] = !1), '/./'[e](t)
          } catch (r) {}
        }
        return !1
      })('includes')
    },
    {
      includes: function(e) {
        return !!~String(g(this)).indexOf(Da(e), arguments.length > 1 ? arguments[1] : void 0)
      }
    }
  )
  var Ra = Fe('species'),
    La = !o(function() {
      var e = /./
      return (
        (e.exec = function() {
          var e = []
          return (e.groups = { a: '7' }), e
        }),
        '7' !== ''.replace(e, '$<a>')
      )
    }),
    Pa = '$0' === 'a'.replace(/./, '$0'),
    ka = !o(function() {
      var e = /(?:)/,
        t = e.exec
      e.exec = function() {
        return t.apply(this, arguments)
      }
      var n = 'ab'.split(e)
      return 2 !== n.length || 'a' !== n[0] || 'b' !== n[1]
    }),
    Ga = function(e, t, n, r) {
      var i = Fe(e),
        a = !o(function() {
          var t = {}
          return (
            (t[i] = function() {
              return 7
            }),
            7 != ''[e](t)
          )
        }),
        s =
          a &&
          !o(function() {
            var t = !1,
              n = /a/
            return (
              'split' === e &&
                (((n = {}).constructor = {}),
                (n.constructor[Ra] = function() {
                  return n
                }),
                (n.flags = ''),
                (n[i] = /./[i])),
              (n.exec = function() {
                return (t = !0), null
              }),
              n[i](''),
              !t
            )
          })
      if (!a || !s || ('replace' === e && (!La || !Pa)) || ('split' === e && !ka)) {
        var u = /./[i],
          c = n(
            i,
            ''[e],
            function(e, t, n, r, o) {
              return t.exec === Sa
                ? a && !o
                  ? { done: !0, value: u.call(t, n, r) }
                  : { done: !0, value: e.call(n, t, r) }
                : { done: !1 }
            },
            { REPLACE_KEEPS_$0: Pa }
          ),
          l = c[0],
          p = c[1]
        Z(String.prototype, e, l),
          Z(
            RegExp.prototype,
            i,
            2 == t
              ? function(e, t) {
                  return p.call(e, this, t)
                }
              : function(e) {
                  return p.call(e, this)
                }
          )
      }
      r && N(RegExp.prototype[i], 'sham', !0)
    },
    wa = Dt.charAt,
    ba = function(e, t, n) {
      return t + (n ? wa(e, t).length : 1)
    },
    Ua = function(e, t) {
      var n = e.exec
      if ('function' == typeof n) {
        var r = n.call(e, t)
        if ('object' != typeof r)
          throw TypeError('RegExp exec method returned something other than an Object or null')
        return r
      }
      if ('RegExp' !== p(e)) throw TypeError('RegExp#exec called on incompatible receiver')
      return Sa.call(e, t)
    }
  Ga('match', 1, function(e, t, n) {
    return [
      function(t) {
        var n = g(this),
          r = null == t ? void 0 : t[e]
        return void 0 !== r ? r.call(t, n) : new RegExp(t)[e](String(n))
      },
      function(e) {
        var r = n(t, e, this)
        if (r.done) return r.value
        var o = O(e),
          i = String(this)
        if (!o.global) return Ua(o, i)
        var a = o.unicode
        o.lastIndex = 0
        for (var s, u = [], c = 0; null !== (s = Ua(o, i)); ) {
          var l = String(s[0])
          ;(u[c] = l), '' === l && (o.lastIndex = ba(i, se(o.lastIndex), a)), c++
        }
        return 0 === c ? null : u
      }
    ]
  })
  var xa = Math.max,
    Fa = Math.min,
    qa = Math.floor,
    Va = /\$([$&'`]|\d\d?|<[^>]*>)/g,
    Ka = /\$([$&'`]|\d\d?)/g
  Ga('replace', 2, function(e, t, n, r) {
    return [
      function(n, r) {
        var o = g(this),
          i = null == n ? void 0 : n[e]
        return void 0 !== i ? i.call(n, o, r) : t.call(String(o), n, r)
      },
      function(e, i) {
        if (r.REPLACE_KEEPS_$0 || ('string' == typeof i && -1 === i.indexOf('$0'))) {
          var a = n(t, e, this, i)
          if (a.done) return a.value
        }
        var s = O(e),
          u = String(this),
          c = 'function' == typeof i
        c || (i = String(i))
        var l = s.global
        if (l) {
          var p = s.unicode
          s.lastIndex = 0
        }
        for (var h = []; ; ) {
          var f = Ua(s, u)
          if (null === f) break
          if ((h.push(f), !l)) break
          '' === String(f[0]) && (s.lastIndex = ba(u, se(s.lastIndex), p))
        }
        for (var g, d = '', m = 0, _ = 0; _ < h.length; _++) {
          f = h[_]
          for (
            var y = String(f[0]), v = xa(Fa(ie(f.index), u.length), 0), E = [], S = 1;
            S < f.length;
            S++
          )
            E.push(void 0 === (g = f[S]) ? g : String(g))
          var I = f.groups
          if (c) {
            var C = [y].concat(E, v, u)
            void 0 !== I && C.push(I)
            var T = String(i.apply(void 0, C))
          } else T = o(y, u, v, E, I, i)
          v >= m && ((d += u.slice(m, v) + T), (m = v + y.length))
        }
        return d + u.slice(m)
      }
    ]
    function o(e, n, r, o, i, a) {
      var s = r + e.length,
        u = o.length,
        c = Ka
      return (
        void 0 !== i && ((i = Pe(i)), (c = Va)),
        t.call(a, c, function(t, a) {
          var c
          switch (a.charAt(0)) {
            case '$':
              return '$'
            case '&':
              return e
            case '`':
              return n.slice(0, r)
            case "'":
              return n.slice(s)
            case '<':
              c = i[a.slice(1, -1)]
              break
            default:
              var l = +a
              if (0 === l) return t
              if (l > u) {
                var p = qa(l / 10)
                return 0 === p
                  ? t
                  : p <= u
                  ? void 0 === o[p - 1]
                    ? a.charAt(1)
                    : o[p - 1] + a.charAt(1)
                  : t
              }
              c = o[l - 1]
          }
          return void 0 === c ? '' : c
        })
      )
    }
  })
  var Ba = Fe('iterator'),
    Ha = Fe('toStringTag'),
    ja = zr.values
  for (var Ya in Jt) {
    var $a = r[Ya],
      Wa = $a && $a.prototype
    if (Wa) {
      if (Wa[Ba] !== ja)
        try {
          N(Wa, Ba, ja)
        } catch (kd) {
          Wa[Ba] = ja
        }
      if ((Wa[Ha] || N(Wa, Ha, Ya), Jt[Ya]))
        for (var za in zr)
          if (Wa[za] !== zr[za])
            try {
              N(Wa, za, zr[za])
            } catch (kd) {
              Wa[za] = zr[za]
            }
    }
  }
  var Xa = So.trim,
    Ja = r.parseFloat,
    Qa =
      1 / Ja(mo + '-0') != -Infinity
        ? function(e) {
            var t = Xa(String(e)),
              n = Ja(t)
            return 0 === n && '-' == t.charAt(0) ? -0 : n
          }
        : Ja
  Ne({ global: !0, forced: parseFloat != Qa }, { parseFloat: Qa })
  var Za = 'undefined' != typeof window,
    es =
      'undefined' != typeof wx &&
      'function' == typeof wx.getSystemInfoSync &&
      'function' == typeof wx.canIUse,
    ts = (Za && window.navigator && window.navigator.userAgent) || '',
    ns = /AppleWebKit\/([\d.]+)/i.exec(ts),
    rs = (ns && parseFloat(ns.pop()), /iPad/i.test(ts)),
    os =
      (/iPhone/i.test(ts),
      /iPod/i.test(ts),
      (function() {
        var e = ts.match(/OS (\d+)_/i)
        e && e[1] && e[1]
      })(),
      /Android/i.test(ts)),
    is = (function() {
      var e = ts.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)
      if (!e) return null
      var t = e[1] && parseFloat(e[1]),
        n = e[2] && parseFloat(e[2])
      return t && n ? parseFloat(e[1] + '.' + e[2]) : t || null
    })(),
    as = (os && /webkit/i.test(ts), /Firefox/i.test(ts), /Edge/i.test(ts)),
    ss = !as && /Chrome/i.test(ts),
    us =
      ((function() {
        var e = ts.match(/Chrome\/(\d+)/)
        e && e[1] && parseFloat(e[1])
      })(),
      /MSIE/.test(ts)),
    cs =
      (/MSIE\s8\.0/.test(ts),
      (function() {
        var e = /MSIE\s(\d+)\.\d/.exec(ts),
          t = e && parseFloat(e[1])
        return !t && /Trident\/7.0/i.test(ts) && /rv:11.0/.test(ts) && (t = 11), t
      })()),
    ls = (/Safari/i.test(ts), /TBS\/\d+/i.test(ts)),
    ps =
      ((function() {
        var e = ts.match(/TBS\/(\d+)/i)
        if (e && e[1]) e[1]
      })(),
      !ls && /MQQBrowser\/\d+/i.test(ts),
      !ls && / QQBrowser\/\d+/i.test(ts),
      /(micromessenger|webbrowser)/i.test(ts)),
    hs = (/Windows/i.test(ts), /MAC OS X/i.test(ts), /MicroMessenger/i.test(ts), Math.max),
    fs = Math.min
  Ne(
    { target: 'Array', proto: !0, forced: !fn('splice') },
    {
      splice: function(e, t) {
        var n,
          r,
          o,
          i,
          a,
          s,
          u = Pe(this),
          c = se(u.length),
          l = le(e, c),
          p = arguments.length
        if (
          (0 === p
            ? (n = r = 0)
            : 1 === p
            ? ((n = 0), (r = c - l))
            : ((n = p - 2), (r = fs(hs(ie(t), 0), c - l))),
          c + n - r > 9007199254740991)
        )
          throw TypeError('Maximum allowed length exceeded')
        for (o = Ve(u, r), i = 0; i < r; i++) (a = l + i) in u && Ze(o, i, u[a])
        if (((o.length = r), n < r)) {
          for (i = l; i < c - r; i++) (s = i + n), (a = i + r) in u ? (u[s] = u[a]) : delete u[s]
          for (i = c; i > c - r + n; i--) delete u[i - 1]
        } else if (n > r)
          for (i = c - r; i > l; i--)
            (s = i + n - 1), (a = i + r - 1) in u ? (u[s] = u[a]) : delete u[s]
        for (i = 0; i < n; i++) u[i + l] = arguments[i + 2]
        return (u.length = c - r + n), o
      }
    }
  )
  var gs = !o(function() {
      return Object.isExtensible(Object.preventExtensions({}))
    }),
    ds = t(function(e) {
      var t = D.f,
        n = K('meta'),
        r = 0,
        o =
          Object.isExtensible ||
          function() {
            return !0
          },
        i = function(e) {
          t(e, n, { value: { objectID: 'O' + ++r, weakData: {} } })
        },
        a = (e.exports = {
          REQUIRED: !1,
          fastKey: function(e, t) {
            if (!m(e)) return 'symbol' == typeof e ? e : ('string' == typeof e ? 'S' : 'P') + e
            if (!v(e, n)) {
              if (!o(e)) return 'F'
              if (!t) return 'E'
              i(e)
            }
            return e[n].objectID
          },
          getWeakData: function(e, t) {
            if (!v(e, n)) {
              if (!o(e)) return !0
              if (!t) return !1
              i(e)
            }
            return e[n].weakData
          },
          onFreeze: function(e) {
            return gs && a.REQUIRED && o(e) && !v(e, n) && i(e), e
          }
        })
      j[n] = !0
    }),
    ms = (ds.REQUIRED, ds.fastKey, ds.getWeakData, ds.onFreeze, D.f),
    _s = ds.fastKey,
    ys = Q.set,
    vs = Q.getterFor,
    Es =
      ((function(e, t, n) {
        var i = -1 !== e.indexOf('Map'),
          a = -1 !== e.indexOf('Weak'),
          s = i ? 'set' : 'add',
          u = r[e],
          c = u && u.prototype,
          l = u,
          p = {},
          h = function(e) {
            var t = c[e]
            Z(
              c,
              e,
              'add' == e
                ? function(e) {
                    return t.call(this, 0 === e ? 0 : e), this
                  }
                : 'delete' == e
                ? function(e) {
                    return !(a && !m(e)) && t.call(this, 0 === e ? 0 : e)
                  }
                : 'get' == e
                ? function(e) {
                    return a && !m(e) ? void 0 : t.call(this, 0 === e ? 0 : e)
                  }
                : 'has' == e
                ? function(e) {
                    return !(a && !m(e)) && t.call(this, 0 === e ? 0 : e)
                  }
                : function(e, n) {
                    return t.call(this, 0 === e ? 0 : e, n), this
                  }
            )
          }
        if (
          Ae(
            e,
            'function' != typeof u ||
              !(
                a ||
                (c.forEach &&
                  !o(function() {
                    new u().entries().next()
                  }))
              )
          )
        )
          (l = n.getConstructor(t, e, i, s)), (ds.REQUIRED = !0)
        else if (Ae(e, !0)) {
          var f = new l(),
            g = f[s](a ? {} : -0, 1) != f,
            d = o(function() {
              f.has(1)
            }),
            _ = ht(function(e) {
              new u(e)
            }),
            y =
              !a &&
              o(function() {
                for (var e = new u(), t = 5; t--; ) e[s](t, t)
                return !e.has(-0)
              })
          _ ||
            (((l = t(function(t, n) {
              zo(t, l, e)
              var r = go(new u(), t, l)
              return null != n && Xo(n, r[s], r, i), r
            })).prototype = c),
            (c.constructor = l)),
            (d || y) && (h('delete'), h('has'), i && h('get')),
            (y || g) && h(s),
            a && c.clear && delete c.clear
        }
        ;(p[e] = l), Ne({ global: !0, forced: l != u }, p), xt(l, e), a || n.setStrong(l, e, i)
      })(
        'Map',
        function(e) {
          return function() {
            return e(this, arguments.length ? arguments[0] : void 0)
          }
        },
        {
          getConstructor: function(e, t, n, r) {
            var o = e(function(e, a) {
                zo(e, o, t),
                  ys(e, { type: t, index: It(null), first: void 0, last: void 0, size: 0 }),
                  i || (e.size = 0),
                  null != a && Xo(a, e[r], e, n)
              }),
              a = vs(t),
              s = function(e, t, n) {
                var r,
                  o,
                  s = a(e),
                  c = u(e, t)
                return (
                  c
                    ? (c.value = n)
                    : ((s.last = c = {
                        index: (o = _s(t, !0)),
                        key: t,
                        value: n,
                        previous: (r = s.last),
                        next: void 0,
                        removed: !1
                      }),
                      s.first || (s.first = c),
                      r && (r.next = c),
                      i ? s.size++ : e.size++,
                      'F' !== o && (s.index[o] = c)),
                  e
                )
              },
              u = function(e, t) {
                var n,
                  r = a(e),
                  o = _s(t)
                if ('F' !== o) return r.index[o]
                for (n = r.first; n; n = n.next) if (n.key == t) return n
              }
            return (
              Yo(o.prototype, {
                clear: function() {
                  for (var e = a(this), t = e.index, n = e.first; n; )
                    (n.removed = !0),
                      n.previous && (n.previous = n.previous.next = void 0),
                      delete t[n.index],
                      (n = n.next)
                  ;(e.first = e.last = void 0), i ? (e.size = 0) : (this.size = 0)
                },
                delete: function(e) {
                  var t = a(this),
                    n = u(this, e)
                  if (n) {
                    var r = n.next,
                      o = n.previous
                    delete t.index[n.index],
                      (n.removed = !0),
                      o && (o.next = r),
                      r && (r.previous = o),
                      t.first == n && (t.first = r),
                      t.last == n && (t.last = o),
                      i ? t.size-- : this.size--
                  }
                  return !!n
                },
                forEach: function(e) {
                  for (
                    var t, n = a(this), r = Le(e, arguments.length > 1 ? arguments[1] : void 0, 3);
                    (t = t ? t.next : n.first);

                  )
                    for (r(t.value, t.key, this); t && t.removed; ) t = t.previous
                },
                has: function(e) {
                  return !!u(this, e)
                }
              }),
              Yo(
                o.prototype,
                n
                  ? {
                      get: function(e) {
                        var t = u(this, e)
                        return t && t.value
                      },
                      set: function(e, t) {
                        return s(this, 0 === e ? 0 : e, t)
                      }
                    }
                  : {
                      add: function(e) {
                        return s(this, (e = 0 === e ? 0 : e), e)
                      }
                    }
              ),
              i &&
                ms(o.prototype, 'size', {
                  get: function() {
                    return a(this).size
                  }
                }),
              o
            )
          },
          setStrong: function(e, t, n) {
            var r = t + ' Iterator',
              o = vs(t),
              i = vs(r)
            $t(
              e,
              t,
              function(e, t) {
                ys(this, { type: r, target: e, state: o(e), kind: t, last: void 0 })
              },
              function() {
                for (var e = i(this), t = e.kind, n = e.last; n && n.removed; ) n = n.previous
                return e.target && (e.last = n = n ? n.next : e.state.first)
                  ? 'keys' == t
                    ? { value: n.key, done: !1 }
                    : 'values' == t
                    ? { value: n.value, done: !1 }
                    : { value: [n.key, n.value], done: !1 }
                  : ((e.target = void 0), { value: void 0, done: !0 })
              },
              n ? 'entries' : 'values',
              !n,
              !0
            ),
              Wo(t)
          }
        }
      ),
      [].push),
    Ss = Math.min,
    Is = !o(function() {
      return !RegExp(4294967295, 'y')
    })
  Ga(
    'split',
    2,
    function(e, t, n) {
      var r
      return (
        (r =
          'c' == 'abbc'.split(/(b)*/)[1] ||
          4 != 'test'.split(/(?:)/, -1).length ||
          2 != 'ab'.split(/(?:ab)*/).length ||
          4 != '.'.split(/(.?)(.?)/).length ||
          '.'.split(/()()/).length > 1 ||
          ''.split(/.?/).length
            ? function(e, n) {
                var r = String(g(this)),
                  o = void 0 === n ? 4294967295 : n >>> 0
                if (0 === o) return []
                if (void 0 === e) return [r]
                if (!Aa(e)) return t.call(r, e, o)
                for (
                  var i,
                    a,
                    s,
                    u = [],
                    c =
                      (e.ignoreCase ? 'i' : '') +
                      (e.multiline ? 'm' : '') +
                      (e.unicode ? 'u' : '') +
                      (e.sticky ? 'y' : ''),
                    l = 0,
                    p = new RegExp(e.source, c + 'g');
                  (i = Sa.call(p, r)) &&
                  !(
                    (a = p.lastIndex) > l &&
                    (u.push(r.slice(l, i.index)),
                    i.length > 1 && i.index < r.length && Es.apply(u, i.slice(1)),
                    (s = i[0].length),
                    (l = a),
                    u.length >= o)
                  );

                )
                  p.lastIndex === i.index && p.lastIndex++
                return (
                  l === r.length ? (!s && p.test('')) || u.push('') : u.push(r.slice(l)),
                  u.length > o ? u.slice(0, o) : u
                )
              }
            : '0'.split(void 0, 0).length
            ? function(e, n) {
                return void 0 === e && 0 === n ? [] : t.call(this, e, n)
              }
            : t),
        [
          function(t, n) {
            var o = g(this),
              i = null == t ? void 0 : t[e]
            return void 0 !== i ? i.call(t, o, n) : r.call(String(o), t, n)
          },
          function(e, o) {
            var i = n(r, e, this, o, r !== t)
            if (i.done) return i.value
            var a = O(e),
              s = String(this),
              u = Qo(a, RegExp),
              c = a.unicode,
              l =
                (a.ignoreCase ? 'i' : '') +
                (a.multiline ? 'm' : '') +
                (a.unicode ? 'u' : '') +
                (Is ? 'y' : 'g'),
              p = new u(Is ? a : '^(?:' + a.source + ')', l),
              h = void 0 === o ? 4294967295 : o >>> 0
            if (0 === h) return []
            if (0 === s.length) return null === Ua(p, s) ? [s] : []
            for (var f = 0, g = 0, d = []; g < s.length; ) {
              p.lastIndex = Is ? g : 0
              var m,
                _ = Ua(p, Is ? s : s.slice(g))
              if (null === _ || (m = Ss(se(p.lastIndex + (Is ? 0 : g)), s.length)) === f)
                g = ba(s, g, c)
              else {
                if ((d.push(s.slice(f, g)), d.length === h)) return d
                for (var y = 1; y <= _.length - 1; y++) if ((d.push(_[y]), d.length === h)) return d
                g = f = m
              }
            }
            return d.push(s.slice(f)), d
          }
        ]
      )
    },
    !Is
  )
  var Cs,
    Ts,
    Ms =
      'undefined' != typeof global
        ? global
        : 'undefined' != typeof self
        ? self
        : 'undefined' != typeof window
        ? window
        : {}
  Cs =
    'undefined' != typeof console
      ? console
      : void 0 !== Ms && Ms.console
      ? Ms.console
      : 'undefined' != typeof window && window.console
      ? window.console
      : {}
  for (
    var Os = function() {},
      As = [
        'assert',
        'clear',
        'count',
        'debug',
        'dir',
        'dirxml',
        'error',
        'exception',
        'group',
        'groupCollapsed',
        'groupEnd',
        'info',
        'log',
        'markTimeline',
        'profile',
        'profileEnd',
        'table',
        'time',
        'timeEnd',
        'timeStamp',
        'trace',
        'warn'
      ],
      Ds = As.length;
    Ds--;

  )
    (Ts = As[Ds]), console[Ts] || (Cs[Ts] = Os)
  Cs.methods = As
  var Ns = Cs,
    Rs = 0,
    Ls = (function() {
      if (es) {
        var e = wx.getSystemInfoSync().SDKVersion
        if (void 0 === e || void 0 === wx.getLogManager) return !1
        if (
          (function(e, t) {
            ;(e = e.split('.')), (t = t.split('.'))
            var n = Math.max(e.length, t.length)
            for (; e.length < n; ) e.push('0')
            for (; t.length < n; ) t.push('0')
            for (var r = 0; r < n; r++) {
              var o = parseInt(e[r]),
                i = parseInt(t[r])
              if (o > i) return 1
              if (o < i) return -1
            }
            return 0
          })(e, '2.1.0') >= 0
        )
          return wx.getLogManager().log('I can use wx log. SDKVersion=' + e), !0
      }
      return !1
    })(),
    Ps = new Map()
  function ks() {
    var e = new Date()
    return (
      'TIM ' +
      e.toLocaleTimeString('en-US', { hour12: !1 }) +
      '.' +
      (function(e) {
        var t
        switch (e.toString().length) {
          case 1:
            t = '00' + e
            break
          case 2:
            t = '0' + e
            break
          default:
            t = e
        }
        return t
      })(e.getMilliseconds()) +
      ':'
    )
  }
  var Gs = {
      _data: [],
      _length: 0,
      _visible: !1,
      arguments2String: function(e) {
        var t
        if (1 === e.length) t = ks() + e[0]
        else {
          t = ks()
          for (var n = 0, r = e.length; n < r; n++)
            Hs(e[n]) ? (Ys(e[n]) ? (t += Qs(e[n])) : (t += JSON.stringify(e[n]))) : (t += e[n]),
              (t += ' ')
        }
        return t
      },
      debug: function() {
        if (Rs <= -1) {
          var e = this.arguments2String(arguments)
          Gs.record(e, 'debug'), Ns.debug(e), Ls && wx.getLogManager().debug(e)
        }
      },
      log: function() {
        if (Rs <= 0) {
          var e = this.arguments2String(arguments)
          Gs.record(e, 'log'), Ns.log(e), Ls && wx.getLogManager().log(e)
        }
      },
      info: function() {
        if (Rs <= 1) {
          var e = this.arguments2String(arguments)
          Gs.record(e, 'info'), Ns.info(e), Ls && wx.getLogManager().info(e)
        }
      },
      warn: function() {
        if (Rs <= 2) {
          var e = this.arguments2String(arguments)
          Gs.record(e, 'warn'), Ns.warn(e), Ls && wx.getLogManager().warn(e)
        }
      },
      error: function() {
        if (Rs <= 3) {
          var e = this.arguments2String(arguments)
          Gs.record(e, 'error'), Ns.error(e), Ls && wx.getLogManager().warn(e)
        }
      },
      time: function(e) {
        Ps.set(e, Xs.now())
      },
      timeEnd: function(e) {
        if (Ps.has(e)) {
          var t = Xs.now() - Ps.get(e)
          return Ps.delete(e), t
        }
        return (
          Ns.warn('未找到对应label: '.concat(e, ', 请在调用 logger.timeEnd 前，调用 logger.time')),
          0
        )
      },
      setLevel: function(e) {
        e < 4 && Ns.log(ks() + 'set level from ' + Rs + ' to ' + e), (Rs = e)
      },
      record: function(e, t) {
        Ls ||
          (1100 === Gs._length && (Gs._data.splice(0, 100), (Gs._length = 1e3)),
          Gs._length++,
          Gs._data.push(''.concat(e, ' [').concat(t, '] \n')))
      },
      getLog: function() {
        return Gs._data
      }
    },
    ws = function(e) {
      return 'map' === $s(e)
    },
    bs = function(e) {
      return 'set' === $s(e)
    },
    Us = function(e) {
      return 'file' === $s(e)
    },
    xs = function(e) {
      return (
        null !== e &&
        (('number' == typeof e && !isNaN(e - 0)) ||
          ('object' === Sn(e) && e.constructor === Number))
      )
    },
    Fs = function(e) {
      return 'string' == typeof e
    },
    qs = function(e) {
      return null !== e && 'object' === Sn(e)
    },
    Vs = function(e) {
      if ('object' !== Sn(e) || null === e) return !1
      var t = Object.getPrototypeOf(e)
      if (null === t) return !0
      for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n)
      return t === n
    },
    Ks = function(e) {
      return 'function' == typeof Array.isArray ? Array.isArray(e) : 'array' === $s(e)
    },
    Bs = function(e) {
      return void 0 === e
    },
    Hs = function(e) {
      return Ks(e) || qs(e)
    },
    js = function(e) {
      return 'function' == typeof e
    },
    Ys = function(e) {
      return e instanceof Error
    },
    $s = function(e) {
      return Object.prototype.toString
        .call(e)
        .match(/^\[object (.*)\]$/)[1]
        .toLowerCase()
    },
    Ws = function(e) {
      if ('string' != typeof e) return !1
      var t = e[0]
      return !/[^a-zA-Z0-9]/.test(t)
    },
    zs = 0
  Date.now ||
    (Date.now = function() {
      return new Date().getTime()
    })
  var Xs = {
      now: function() {
        0 === zs && (zs = Date.now() - 1)
        var e = Date.now() - zs
        return e > 4294967295 ? ((zs += 4294967295), Date.now() - zs) : e
      },
      utc: function() {
        return Math.round(Date.now() / 1e3)
      }
    },
    Js = function e(t, n, r, o) {
      if (!Hs(t) || !Hs(n)) return 0
      for (var i, a = 0, s = Object.keys(n), u = 0, c = s.length; u < c; u++)
        if (((i = s[u]), !(Bs(n[i]) || (r && r.includes(i)))))
          if (Hs(t[i]) && Hs(n[i])) a += e(t[i], n[i], r, o)
          else {
            if (o && o.includes(n[i])) continue
            t[i] !== n[i] && ((t[i] = n[i]), (a += 1))
          }
      return a
    },
    Qs = function(e) {
      return JSON.stringify(e, ['message', 'code'])
    },
    Zs = function() {
      var e = new Date(),
        t = e.toISOString(),
        n = e.getTimezoneOffset() / 60,
        r = ''
      return (
        (r =
          n < 0
            ? n > -10
              ? '+0' + Math.abs(100 * n)
              : '+' + Math.abs(100 * n)
            : n >= 10
            ? '-' + 100 * n
            : '-0' + 100 * n),
        t.replace('Z', r)
      )
    },
    eu = function(e) {
      if (0 === e.length) return 0
      for (
        var t = 0,
          n = 0,
          r =
            'undefined' != typeof document && void 0 !== document.characterSet
              ? document.characterSet
              : 'UTF-8';
        void 0 !== e[t];

      )
        n += e[t++].charCodeAt[t] <= 255 ? 1 : !1 === r ? 3 : 2
      return n
    },
    tu = function(e) {
      var t = e || 99999999
      return Math.round(Math.random() * t)
    },
    nu = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
    ru = nu.length,
    ou = function(e, t) {
      for (var n in e) if (e[n] === t) return !0
      return !1
    },
    iu = {},
    au = function() {
      if (es) return 'https:'
      var e = window.location.protocol
      return ['http:', 'https:'].indexOf(e) < 0 && (e = 'http:'), e
    },
    su = function(e) {
      return -1 === e.indexOf('http://') || -1 === e.indexOf('https://')
        ? 'https://' + e
        : e.replace(/https|http/, 'https')
    }
  function uu(e, t) {
    Ks(e) && Ks(t)
      ? t.forEach(function(t) {
          var n = t.key,
            r = t.value,
            o = e.find(function(e) {
              return e.key === n
            })
          o ? (o.value = r) : e.push({ key: n, value: r })
        })
      : Gs.warn('updateCustomField target 或 source 不是数组，忽略此次更新。')
  }
  var cu = function(e) {
      return e === an.GRP_PUBLIC
    },
    lu = function(e) {
      return e === an.GRP_AVCHATROOM
    },
    pu = function(e) {
      return Fs(e) && e === an.CONV_SYSTEM
    }
  function hu(e, t) {
    var n = {}
    return (
      Object.keys(e).forEach(function(r) {
        n[r] = t(e[r], r)
      }),
      n
    )
  }
  var fu = Object.prototype.hasOwnProperty
  function gu(e) {
    if (null == e) return !0
    if ('boolean' == typeof e) return !1
    if ('number' == typeof e) return 0 === e
    if ('string' == typeof e) return 0 === e.length
    if ('function' == typeof e) return 0 === e.length
    if (Array.isArray(e)) return 0 === e.length
    if (e instanceof Error) return '' === e.message
    if (Vs(e)) {
      for (var t in e) if (fu.call(e, t)) return !1
      return !0
    }
    return !!(ws(e) || bs(e) || Us(e)) && 0 === e.size
  }
  function du(e, t, n) {
    if (void 0 === t) return !0
    var r = !0
    if ('object' === Yn(t).toLowerCase())
      Object.keys(t).forEach(function(o) {
        var i = 1 === e.length ? e[0][o] : void 0
        r = !!mu(i, t[o], n, o) && r
      })
    else if ('array' === Yn(t).toLowerCase())
      for (var o = 0; o < t.length; o++) r = !!mu(e[o], t[o], n, t[o].name) && r
    if (r) return r
    throw new Error('Params validate failed.')
  }
  function mu(e, t, n, r) {
    if (void 0 === t) return !0
    var o = !0
    return (
      t.required &&
        gu(e) &&
        (Ns.error('TIM ['.concat(n, '] Missing required params: "').concat(r, '".')), (o = !1)),
      gu(e) ||
        Yn(e).toLowerCase() === t.type.toLowerCase() ||
        (Ns.error(
          'TIM ['
            .concat(n, '] Invalid params: type check failed for "')
            .concat(r, '".Expected ')
            .concat(t.type, '.')
        ),
        (o = !1)),
      t.validator &&
        !t.validator(e) &&
        (Ns.error('TIM ['.concat(n, '] Invalid params: custom validator check failed for params.')),
        (o = !1)),
      o
    )
  }
  var _u = { SUCCESS: 'JoinedSuccess', WAIT_APPROVAL: 'WaitAdminApproval' },
    yu = {
      COMMON: { SUCCESS: 'OK', FAIL: 'FAIL' },
      REQUEST: { SUCCESS: 0 },
      ACCESS_LAYER: { PRODUCTION: 0, TEST: 1 },
      LOGIN: { IS_LOGIN: 1, IS_NOT_LOGIN: 0 },
      SYNC_MESSAGE: { SYNCHRONIZATION_START: 0, SYNCHRONIZING: 1, SYNCHRONIZED: 2 },
      MESSAGE_STATUS: { UNSEND: 'unSend', SUCCESS: 'success', FAIL: 'fail' },
      GET_HISTORY_MESSAGE_STATUS: {
        C2C_IS_FINISHED: 1,
        C2C_IS_NOT_FINISHED: 0,
        GROUP_IS_FINISHED: 1,
        GROUP_IS_NOT_FINISHED: 0
      },
      ACCOUNT_STATUS: { SIGN_IN: !0, SIGN_OUT: !1 },
      CHANNEL_STATUS: { ONLINE: !0, OFFLINE: !1 },
      JOIN_GROUP_STATUS: _u,
      UPLOAD: { FINISHED: 1, UPLOADING: 0 },
      PAGING_CONVERSATION: {
        NOT_START: 'notStart',
        PENDING: 'pengding',
        RESOLVED: 'resolved',
        REJECTED: 'rejected'
      }
    },
    vu = (function() {
      function e(t) {
        In(this, e), (this.type = an.MSG_TEXT), (this.content = { text: t.text || '' })
      }
      return (
        Tn(e, [
          {
            key: 'setText',
            value: function(e) {
              this.content.text = e
            }
          },
          {
            key: 'sendable',
            value: function() {
              return 0 !== this.content.text.length
            }
          }
        ]),
        e
      )
    })(),
    Eu = Fe('iterator'),
    Su = !o(function() {
      var e = new URL('b?a=1&b=2&c=3', 'http://a'),
        t = e.searchParams,
        n = ''
      return (
        (e.pathname = 'c%20d'),
        t.forEach(function(e, r) {
          t.delete('b'), (n += r + e)
        }),
        !t.sort ||
          'http://a/c%20d?a=1&c=3' !== e.href ||
          '3' !== t.get('c') ||
          'a=1' !== String(new URLSearchParams('?a=1')) ||
          !t[Eu] ||
          'a' !== new URL('https://a@b').username ||
          'b' !== new URLSearchParams(new URLSearchParams('a=b')).get('a') ||
          'xn--e1aybc' !== new URL('http://тест').host ||
          '#%D0%B1' !== new URL('http://a#б').hash ||
          'a1c3' !== n ||
          'x' !== new URL('http://x', void 0).host
      )
    }),
    Iu = Object.assign,
    Cu = Object.defineProperty,
    Tu =
      !Iu ||
      o(function() {
        if (
          i &&
          1 !==
            Iu(
              { b: 1 },
              Iu(
                Cu({}, 'a', {
                  enumerable: !0,
                  get: function() {
                    Cu(this, 'b', { value: 3, enumerable: !1 })
                  }
                }),
                { b: 2 }
              )
            ).b
        )
          return !0
        var e = {},
          t = {},
          n = Symbol()
        return (
          (e[n] = 7),
          'abcdefghijklmnopqrst'.split('').forEach(function(e) {
            t[e] = e
          }),
          7 != Iu({}, e)[n] || 'abcdefghijklmnopqrst' != dt(Iu({}, t)).join('')
        )
      })
        ? function(e, t) {
            for (var n = Pe(e), r = arguments.length, o = 1, a = ye.f, s = u.f; r > o; )
              for (
                var c,
                  l = f(arguments[o++]),
                  p = a ? dt(l).concat(a(l)) : dt(l),
                  h = p.length,
                  g = 0;
                h > g;

              )
                (c = p[g++]), (i && !s.call(l, c)) || (n[c] = l[c])
            return n
          }
        : Iu,
    Mu = /[^\0-\u007E]/,
    Ou = /[.\u3002\uFF0E\uFF61]/g,
    Au = 'Overflow: input needs wider integers to process',
    Du = Math.floor,
    Nu = String.fromCharCode,
    Ru = function(e) {
      return e + 22 + 75 * (e < 26)
    },
    Lu = function(e, t, n) {
      var r = 0
      for (e = n ? Du(e / 700) : e >> 1, e += Du(e / t); e > 455; r += 36) e = Du(e / 35)
      return Du(r + (36 * e) / (e + 38))
    },
    Pu = function(e) {
      var t,
        n,
        r = [],
        o = (e = (function(e) {
          for (var t = [], n = 0, r = e.length; n < r; ) {
            var o = e.charCodeAt(n++)
            if (o >= 55296 && o <= 56319 && n < r) {
              var i = e.charCodeAt(n++)
              56320 == (64512 & i)
                ? t.push(((1023 & o) << 10) + (1023 & i) + 65536)
                : (t.push(o), n--)
            } else t.push(o)
          }
          return t
        })(e)).length,
        i = 128,
        a = 0,
        s = 72
      for (t = 0; t < e.length; t++) (n = e[t]) < 128 && r.push(Nu(n))
      var u = r.length,
        c = u
      for (u && r.push('-'); c < o; ) {
        var l = 2147483647
        for (t = 0; t < e.length; t++) (n = e[t]) >= i && n < l && (l = n)
        var p = c + 1
        if (l - i > Du((2147483647 - a) / p)) throw RangeError(Au)
        for (a += (l - i) * p, i = l, t = 0; t < e.length; t++) {
          if ((n = e[t]) < i && ++a > 2147483647) throw RangeError(Au)
          if (n == i) {
            for (var h = a, f = 36; ; f += 36) {
              var g = f <= s ? 1 : f >= s + 26 ? 26 : f - s
              if (h < g) break
              var d = h - g,
                m = 36 - g
              r.push(Nu(Ru(g + (d % m)))), (h = Du(d / m))
            }
            r.push(Nu(Ru(h))), (s = Lu(a, p, c == u)), (a = 0), ++c
          }
        }
        ++a, ++i
      }
      return r.join('')
    },
    ku = function(e) {
      var t = at(e)
      if ('function' != typeof t) throw TypeError(String(e) + ' is not iterable')
      return O(t.call(e))
    },
    Gu = ne('fetch'),
    wu = ne('Headers'),
    bu = Fe('iterator'),
    Uu = Q.set,
    xu = Q.getterFor('URLSearchParams'),
    Fu = Q.getterFor('URLSearchParamsIterator'),
    qu = /\+/g,
    Vu = Array(4),
    Ku = function(e) {
      return Vu[e - 1] || (Vu[e - 1] = RegExp('((?:%[\\da-f]{2}){' + e + '})', 'gi'))
    },
    Bu = function(e) {
      try {
        return decodeURIComponent(e)
      } catch (kd) {
        return e
      }
    },
    Hu = function(e) {
      var t = e.replace(qu, ' '),
        n = 4
      try {
        return decodeURIComponent(t)
      } catch (kd) {
        for (; n; ) t = t.replace(Ku(n--), Bu)
        return t
      }
    },
    ju = /[!'()~]|%20/g,
    Yu = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+' },
    $u = function(e) {
      return Yu[e]
    },
    Wu = function(e) {
      return encodeURIComponent(e).replace(ju, $u)
    },
    zu = function(e, t) {
      if (t)
        for (var n, r, o = t.split('&'), i = 0; i < o.length; )
          (n = o[i++]).length &&
            ((r = n.split('=')), e.push({ key: Hu(r.shift()), value: Hu(r.join('=')) }))
    },
    Xu = function(e) {
      ;(this.entries.length = 0), zu(this.entries, e)
    },
    Ju = function(e, t) {
      if (e < t) throw TypeError('Not enough arguments')
    },
    Qu = Vt(
      function(e, t) {
        Uu(this, { type: 'URLSearchParamsIterator', iterator: ku(xu(e).entries), kind: t })
      },
      'Iterator',
      function() {
        var e = Fu(this),
          t = e.kind,
          n = e.iterator.next(),
          r = n.value
        return (
          n.done || (n.value = 'keys' === t ? r.key : 'values' === t ? r.value : [r.key, r.value]),
          n
        )
      }
    ),
    Zu = function() {
      zo(this, Zu, 'URLSearchParams')
      var e,
        t,
        n,
        r,
        o,
        i,
        a,
        s,
        u,
        c = arguments.length > 0 ? arguments[0] : void 0,
        l = this,
        p = []
      if (
        (Uu(l, {
          type: 'URLSearchParams',
          entries: p,
          updateURL: function() {},
          updateSearchParams: Xu
        }),
        void 0 !== c)
      )
        if (m(c))
          if ('function' == typeof (e = at(c)))
            for (n = (t = e.call(c)).next; !(r = n.call(t)).done; ) {
              if (
                (a = (i = (o = ku(O(r.value))).next).call(o)).done ||
                (s = i.call(o)).done ||
                !i.call(o).done
              )
                throw TypeError('Expected sequence with length 2')
              p.push({ key: a.value + '', value: s.value + '' })
            }
          else for (u in c) v(c, u) && p.push({ key: u, value: c[u] + '' })
        else zu(p, 'string' == typeof c ? ('?' === c.charAt(0) ? c.slice(1) : c) : c + '')
    },
    ec = Zu.prototype
  Yo(
    ec,
    {
      append: function(e, t) {
        Ju(arguments.length, 2)
        var n = xu(this)
        n.entries.push({ key: e + '', value: t + '' }), n.updateURL()
      },
      delete: function(e) {
        Ju(arguments.length, 1)
        for (var t = xu(this), n = t.entries, r = e + '', o = 0; o < n.length; )
          n[o].key === r ? n.splice(o, 1) : o++
        t.updateURL()
      },
      get: function(e) {
        Ju(arguments.length, 1)
        for (var t = xu(this).entries, n = e + '', r = 0; r < t.length; r++)
          if (t[r].key === n) return t[r].value
        return null
      },
      getAll: function(e) {
        Ju(arguments.length, 1)
        for (var t = xu(this).entries, n = e + '', r = [], o = 0; o < t.length; o++)
          t[o].key === n && r.push(t[o].value)
        return r
      },
      has: function(e) {
        Ju(arguments.length, 1)
        for (var t = xu(this).entries, n = e + '', r = 0; r < t.length; )
          if (t[r++].key === n) return !0
        return !1
      },
      set: function(e, t) {
        Ju(arguments.length, 1)
        for (
          var n, r = xu(this), o = r.entries, i = !1, a = e + '', s = t + '', u = 0;
          u < o.length;
          u++
        )
          (n = o[u]).key === a && (i ? o.splice(u--, 1) : ((i = !0), (n.value = s)))
        i || o.push({ key: a, value: s }), r.updateURL()
      },
      sort: function() {
        var e,
          t,
          n,
          r = xu(this),
          o = r.entries,
          i = o.slice()
        for (o.length = 0, n = 0; n < i.length; n++) {
          for (e = i[n], t = 0; t < n; t++)
            if (o[t].key > e.key) {
              o.splice(t, 0, e)
              break
            }
          t === n && o.push(e)
        }
        r.updateURL()
      },
      forEach: function(e) {
        for (
          var t,
            n = xu(this).entries,
            r = Le(e, arguments.length > 1 ? arguments[1] : void 0, 3),
            o = 0;
          o < n.length;

        )
          r((t = n[o++]).value, t.key, this)
      },
      keys: function() {
        return new Qu(this, 'keys')
      },
      values: function() {
        return new Qu(this, 'values')
      },
      entries: function() {
        return new Qu(this, 'entries')
      }
    },
    { enumerable: !0 }
  ),
    Z(ec, bu, ec.entries),
    Z(
      ec,
      'toString',
      function() {
        for (var e, t = xu(this).entries, n = [], r = 0; r < t.length; )
          (e = t[r++]), n.push(Wu(e.key) + '=' + Wu(e.value))
        return n.join('&')
      },
      { enumerable: !0 }
    ),
    xt(Zu, 'URLSearchParams'),
    Ne({ global: !0, forced: !Su }, { URLSearchParams: Zu }),
    Su ||
      'function' != typeof Gu ||
      'function' != typeof wu ||
      Ne(
        { global: !0, enumerable: !0, forced: !0 },
        {
          fetch: function(e) {
            var t,
              n,
              r,
              o = [e]
            return (
              arguments.length > 1 &&
                ((t = arguments[1]),
                m(t) &&
                  ((n = t.body),
                  'URLSearchParams' === ot(n) &&
                    ((r = t.headers ? new wu(t.headers) : new wu()).has('content-type') ||
                      r.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'),
                    (t = It(t, { body: c(0, String(n)), headers: c(0, r) })))),
                o.push(t)),
              Gu.apply(this, o)
            )
          }
        }
      )
  var tc,
    nc = { URLSearchParams: Zu, getState: xu },
    rc = Dt.codeAt,
    oc = r.URL,
    ic = nc.URLSearchParams,
    ac = nc.getState,
    sc = Q.set,
    uc = Q.getterFor('URL'),
    cc = Math.floor,
    lc = Math.pow,
    pc = /[A-Za-z]/,
    hc = /[\d+\-.A-Za-z]/,
    fc = /\d/,
    gc = /^(0x|0X)/,
    dc = /^[0-7]+$/,
    mc = /^\d+$/,
    _c = /^[\dA-Fa-f]+$/,
    yc = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,
    vc = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/,
    Ec = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,
    Sc = /[\u0009\u000A\u000D]/g,
    Ic = function(e, t) {
      var n, r, o
      if ('[' == t.charAt(0)) {
        if (']' != t.charAt(t.length - 1)) return 'Invalid host'
        if (!(n = Tc(t.slice(1, -1)))) return 'Invalid host'
        e.host = n
      } else if (Pc(e)) {
        if (
          ((t = (function(e) {
            var t,
              n,
              r = [],
              o = e
                .toLowerCase()
                .replace(Ou, '.')
                .split('.')
            for (t = 0; t < o.length; t++) (n = o[t]), r.push(Mu.test(n) ? 'xn--' + Pu(n) : n)
            return r.join('.')
          })(t)),
          yc.test(t))
        )
          return 'Invalid host'
        if (null === (n = Cc(t))) return 'Invalid host'
        e.host = n
      } else {
        if (vc.test(t)) return 'Invalid host'
        for (n = '', r = st(t), o = 0; o < r.length; o++) n += Rc(r[o], Oc)
        e.host = n
      }
    },
    Cc = function(e) {
      var t,
        n,
        r,
        o,
        i,
        a,
        s,
        u = e.split('.')
      if ((u.length && '' == u[u.length - 1] && u.pop(), (t = u.length) > 4)) return e
      for (n = [], r = 0; r < t; r++) {
        if ('' == (o = u[r])) return e
        if (
          ((i = 10),
          o.length > 1 &&
            '0' == o.charAt(0) &&
            ((i = gc.test(o) ? 16 : 8), (o = o.slice(8 == i ? 1 : 2))),
          '' === o)
        )
          a = 0
        else {
          if (!(10 == i ? mc : 8 == i ? dc : _c).test(o)) return e
          a = parseInt(o, i)
        }
        n.push(a)
      }
      for (r = 0; r < t; r++)
        if (((a = n[r]), r == t - 1)) {
          if (a >= lc(256, 5 - t)) return null
        } else if (a > 255) return null
      for (s = n.pop(), r = 0; r < n.length; r++) s += n[r] * lc(256, 3 - r)
      return s
    },
    Tc = function(e) {
      var t,
        n,
        r,
        o,
        i,
        a,
        s,
        u = [0, 0, 0, 0, 0, 0, 0, 0],
        c = 0,
        l = null,
        p = 0,
        h = function() {
          return e.charAt(p)
        }
      if (':' == h()) {
        if (':' != e.charAt(1)) return
        ;(p += 2), (l = ++c)
      }
      for (; h(); ) {
        if (8 == c) return
        if (':' != h()) {
          for (t = n = 0; n < 4 && _c.test(h()); ) (t = 16 * t + parseInt(h(), 16)), p++, n++
          if ('.' == h()) {
            if (0 == n) return
            if (((p -= n), c > 6)) return
            for (r = 0; h(); ) {
              if (((o = null), r > 0)) {
                if (!('.' == h() && r < 4)) return
                p++
              }
              if (!fc.test(h())) return
              for (; fc.test(h()); ) {
                if (((i = parseInt(h(), 10)), null === o)) o = i
                else {
                  if (0 == o) return
                  o = 10 * o + i
                }
                if (o > 255) return
                p++
              }
              ;(u[c] = 256 * u[c] + o), (2 != ++r && 4 != r) || c++
            }
            if (4 != r) return
            break
          }
          if (':' == h()) {
            if ((p++, !h())) return
          } else if (h()) return
          u[c++] = t
        } else {
          if (null !== l) return
          p++, (l = ++c)
        }
      }
      if (null !== l)
        for (a = c - l, c = 7; 0 != c && a > 0; )
          (s = u[c]), (u[c--] = u[l + a - 1]), (u[l + --a] = s)
      else if (8 != c) return
      return u
    },
    Mc = function(e) {
      var t, n, r, o
      if ('number' == typeof e) {
        for (t = [], n = 0; n < 4; n++) t.unshift(e % 256), (e = cc(e / 256))
        return t.join('.')
      }
      if ('object' == typeof e) {
        for (
          t = '',
            r = (function(e) {
              for (var t = null, n = 1, r = null, o = 0, i = 0; i < 8; i++)
                0 !== e[i]
                  ? (o > n && ((t = r), (n = o)), (r = null), (o = 0))
                  : (null === r && (r = i), ++o)
              return o > n && ((t = r), (n = o)), t
            })(e),
            n = 0;
          n < 8;
          n++
        )
          (o && 0 === e[n]) ||
            (o && (o = !1),
            r === n
              ? ((t += n ? ':' : '::'), (o = !0))
              : ((t += e[n].toString(16)), n < 7 && (t += ':')))
        return '[' + t + ']'
      }
      return e
    },
    Oc = {},
    Ac = Tu({}, Oc, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }),
    Dc = Tu({}, Ac, { '#': 1, '?': 1, '{': 1, '}': 1 }),
    Nc = Tu({}, Dc, {
      '/': 1,
      ':': 1,
      ';': 1,
      '=': 1,
      '@': 1,
      '[': 1,
      '\\': 1,
      ']': 1,
      '^': 1,
      '|': 1
    }),
    Rc = function(e, t) {
      var n = rc(e, 0)
      return n > 32 && n < 127 && !v(t, e) ? e : encodeURIComponent(e)
    },
    Lc = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 },
    Pc = function(e) {
      return v(Lc, e.scheme)
    },
    kc = function(e) {
      return '' != e.username || '' != e.password
    },
    Gc = function(e) {
      return !e.host || e.cannotBeABaseURL || 'file' == e.scheme
    },
    wc = function(e, t) {
      var n
      return 2 == e.length && pc.test(e.charAt(0)) && (':' == (n = e.charAt(1)) || (!t && '|' == n))
    },
    bc = function(e) {
      var t
      return (
        e.length > 1 &&
        wc(e.slice(0, 2)) &&
        (2 == e.length || '/' === (t = e.charAt(2)) || '\\' === t || '?' === t || '#' === t)
      )
    },
    Uc = function(e) {
      var t = e.path,
        n = t.length
      !n || ('file' == e.scheme && 1 == n && wc(t[0], !0)) || t.pop()
    },
    xc = function(e) {
      return '.' === e || '%2e' === e.toLowerCase()
    },
    Fc = {},
    qc = {},
    Vc = {},
    Kc = {},
    Bc = {},
    Hc = {},
    jc = {},
    Yc = {},
    $c = {},
    Wc = {},
    zc = {},
    Xc = {},
    Jc = {},
    Qc = {},
    Zc = {},
    el = {},
    tl = {},
    nl = {},
    rl = {},
    ol = {},
    il = {},
    al = function(e, t, n, r) {
      var o,
        i,
        a,
        s,
        u,
        c = n || Fc,
        l = 0,
        p = '',
        h = !1,
        f = !1,
        g = !1
      for (
        n ||
          ((e.scheme = ''),
          (e.username = ''),
          (e.password = ''),
          (e.host = null),
          (e.port = null),
          (e.path = []),
          (e.query = null),
          (e.fragment = null),
          (e.cannotBeABaseURL = !1),
          (t = t.replace(Ec, ''))),
          t = t.replace(Sc, ''),
          o = st(t);
        l <= o.length;

      ) {
        switch (((i = o[l]), c)) {
          case Fc:
            if (!i || !pc.test(i)) {
              if (n) return 'Invalid scheme'
              c = Vc
              continue
            }
            ;(p += i.toLowerCase()), (c = qc)
            break
          case qc:
            if (i && (hc.test(i) || '+' == i || '-' == i || '.' == i)) p += i.toLowerCase()
            else {
              if (':' != i) {
                if (n) return 'Invalid scheme'
                ;(p = ''), (c = Vc), (l = 0)
                continue
              }
              if (
                n &&
                (Pc(e) != v(Lc, p) ||
                  ('file' == p && (kc(e) || null !== e.port)) ||
                  ('file' == e.scheme && !e.host))
              )
                return
              if (((e.scheme = p), n))
                return void (Pc(e) && Lc[e.scheme] == e.port && (e.port = null))
              ;(p = ''),
                'file' == e.scheme
                  ? (c = Qc)
                  : Pc(e) && r && r.scheme == e.scheme
                  ? (c = Kc)
                  : Pc(e)
                  ? (c = Yc)
                  : '/' == o[l + 1]
                  ? ((c = Bc), l++)
                  : ((e.cannotBeABaseURL = !0), e.path.push(''), (c = rl))
            }
            break
          case Vc:
            if (!r || (r.cannotBeABaseURL && '#' != i)) return 'Invalid scheme'
            if (r.cannotBeABaseURL && '#' == i) {
              ;(e.scheme = r.scheme),
                (e.path = r.path.slice()),
                (e.query = r.query),
                (e.fragment = ''),
                (e.cannotBeABaseURL = !0),
                (c = il)
              break
            }
            c = 'file' == r.scheme ? Qc : Hc
            continue
          case Kc:
            if ('/' != i || '/' != o[l + 1]) {
              c = Hc
              continue
            }
            ;(c = $c), l++
            break
          case Bc:
            if ('/' == i) {
              c = Wc
              break
            }
            c = nl
            continue
          case Hc:
            if (((e.scheme = r.scheme), i == tc))
              (e.username = r.username),
                (e.password = r.password),
                (e.host = r.host),
                (e.port = r.port),
                (e.path = r.path.slice()),
                (e.query = r.query)
            else if ('/' == i || ('\\' == i && Pc(e))) c = jc
            else if ('?' == i)
              (e.username = r.username),
                (e.password = r.password),
                (e.host = r.host),
                (e.port = r.port),
                (e.path = r.path.slice()),
                (e.query = ''),
                (c = ol)
            else {
              if ('#' != i) {
                ;(e.username = r.username),
                  (e.password = r.password),
                  (e.host = r.host),
                  (e.port = r.port),
                  (e.path = r.path.slice()),
                  e.path.pop(),
                  (c = nl)
                continue
              }
              ;(e.username = r.username),
                (e.password = r.password),
                (e.host = r.host),
                (e.port = r.port),
                (e.path = r.path.slice()),
                (e.query = r.query),
                (e.fragment = ''),
                (c = il)
            }
            break
          case jc:
            if (!Pc(e) || ('/' != i && '\\' != i)) {
              if ('/' != i) {
                ;(e.username = r.username),
                  (e.password = r.password),
                  (e.host = r.host),
                  (e.port = r.port),
                  (c = nl)
                continue
              }
              c = Wc
            } else c = $c
            break
          case Yc:
            if (((c = $c), '/' != i || '/' != p.charAt(l + 1))) continue
            l++
            break
          case $c:
            if ('/' != i && '\\' != i) {
              c = Wc
              continue
            }
            break
          case Wc:
            if ('@' == i) {
              h && (p = '%40' + p), (h = !0), (a = st(p))
              for (var d = 0; d < a.length; d++) {
                var m = a[d]
                if (':' != m || g) {
                  var _ = Rc(m, Nc)
                  g ? (e.password += _) : (e.username += _)
                } else g = !0
              }
              p = ''
            } else if (i == tc || '/' == i || '?' == i || '#' == i || ('\\' == i && Pc(e))) {
              if (h && '' == p) return 'Invalid authority'
              ;(l -= st(p).length + 1), (p = ''), (c = zc)
            } else p += i
            break
          case zc:
          case Xc:
            if (n && 'file' == e.scheme) {
              c = el
              continue
            }
            if (':' != i || f) {
              if (i == tc || '/' == i || '?' == i || '#' == i || ('\\' == i && Pc(e))) {
                if (Pc(e) && '' == p) return 'Invalid host'
                if (n && '' == p && (kc(e) || null !== e.port)) return
                if ((s = Ic(e, p))) return s
                if (((p = ''), (c = tl), n)) return
                continue
              }
              '[' == i ? (f = !0) : ']' == i && (f = !1), (p += i)
            } else {
              if ('' == p) return 'Invalid host'
              if ((s = Ic(e, p))) return s
              if (((p = ''), (c = Jc), n == Xc)) return
            }
            break
          case Jc:
            if (!fc.test(i)) {
              if (i == tc || '/' == i || '?' == i || '#' == i || ('\\' == i && Pc(e)) || n) {
                if ('' != p) {
                  var y = parseInt(p, 10)
                  if (y > 65535) return 'Invalid port'
                  ;(e.port = Pc(e) && y === Lc[e.scheme] ? null : y), (p = '')
                }
                if (n) return
                c = tl
                continue
              }
              return 'Invalid port'
            }
            p += i
            break
          case Qc:
            if (((e.scheme = 'file'), '/' == i || '\\' == i)) c = Zc
            else {
              if (!r || 'file' != r.scheme) {
                c = nl
                continue
              }
              if (i == tc) (e.host = r.host), (e.path = r.path.slice()), (e.query = r.query)
              else if ('?' == i)
                (e.host = r.host), (e.path = r.path.slice()), (e.query = ''), (c = ol)
              else {
                if ('#' != i) {
                  bc(o.slice(l).join('')) || ((e.host = r.host), (e.path = r.path.slice()), Uc(e)),
                    (c = nl)
                  continue
                }
                ;(e.host = r.host),
                  (e.path = r.path.slice()),
                  (e.query = r.query),
                  (e.fragment = ''),
                  (c = il)
              }
            }
            break
          case Zc:
            if ('/' == i || '\\' == i) {
              c = el
              break
            }
            r &&
              'file' == r.scheme &&
              !bc(o.slice(l).join('')) &&
              (wc(r.path[0], !0) ? e.path.push(r.path[0]) : (e.host = r.host)),
              (c = nl)
            continue
          case el:
            if (i == tc || '/' == i || '\\' == i || '?' == i || '#' == i) {
              if (!n && wc(p)) c = nl
              else if ('' == p) {
                if (((e.host = ''), n)) return
                c = tl
              } else {
                if ((s = Ic(e, p))) return s
                if (('localhost' == e.host && (e.host = ''), n)) return
                ;(p = ''), (c = tl)
              }
              continue
            }
            p += i
            break
          case tl:
            if (Pc(e)) {
              if (((c = nl), '/' != i && '\\' != i)) continue
            } else if (n || '?' != i)
              if (n || '#' != i) {
                if (i != tc && ((c = nl), '/' != i)) continue
              } else (e.fragment = ''), (c = il)
            else (e.query = ''), (c = ol)
            break
          case nl:
            if (i == tc || '/' == i || ('\\' == i && Pc(e)) || (!n && ('?' == i || '#' == i))) {
              if (
                ('..' === (u = (u = p).toLowerCase()) ||
                '%2e.' === u ||
                '.%2e' === u ||
                '%2e%2e' === u
                  ? (Uc(e), '/' == i || ('\\' == i && Pc(e)) || e.path.push(''))
                  : xc(p)
                  ? '/' == i || ('\\' == i && Pc(e)) || e.path.push('')
                  : ('file' == e.scheme &&
                      !e.path.length &&
                      wc(p) &&
                      (e.host && (e.host = ''), (p = p.charAt(0) + ':')),
                    e.path.push(p)),
                (p = ''),
                'file' == e.scheme && (i == tc || '?' == i || '#' == i))
              )
                for (; e.path.length > 1 && '' === e.path[0]; ) e.path.shift()
              '?' == i ? ((e.query = ''), (c = ol)) : '#' == i && ((e.fragment = ''), (c = il))
            } else p += Rc(i, Dc)
            break
          case rl:
            '?' == i
              ? ((e.query = ''), (c = ol))
              : '#' == i
              ? ((e.fragment = ''), (c = il))
              : i != tc && (e.path[0] += Rc(i, Oc))
            break
          case ol:
            n || '#' != i
              ? i != tc &&
                ("'" == i && Pc(e) ? (e.query += '%27') : (e.query += '#' == i ? '%23' : Rc(i, Oc)))
              : ((e.fragment = ''), (c = il))
            break
          case il:
            i != tc && (e.fragment += Rc(i, Ac))
        }
        l++
      }
    },
    sl = function(e) {
      var t,
        n,
        r = zo(this, sl, 'URL'),
        o = arguments.length > 1 ? arguments[1] : void 0,
        a = String(e),
        s = sc(r, { type: 'URL' })
      if (void 0 !== o)
        if (o instanceof sl) t = uc(o)
        else if ((n = al((t = {}), String(o)))) throw TypeError(n)
      if ((n = al(s, a, null, t))) throw TypeError(n)
      var u = (s.searchParams = new ic()),
        c = ac(u)
      c.updateSearchParams(s.query),
        (c.updateURL = function() {
          s.query = String(u) || null
        }),
        i ||
          ((r.href = cl.call(r)),
          (r.origin = ll.call(r)),
          (r.protocol = pl.call(r)),
          (r.username = hl.call(r)),
          (r.password = fl.call(r)),
          (r.host = gl.call(r)),
          (r.hostname = dl.call(r)),
          (r.port = ml.call(r)),
          (r.pathname = _l.call(r)),
          (r.search = yl.call(r)),
          (r.searchParams = vl.call(r)),
          (r.hash = El.call(r)))
    },
    ul = sl.prototype,
    cl = function() {
      var e = uc(this),
        t = e.scheme,
        n = e.username,
        r = e.password,
        o = e.host,
        i = e.port,
        a = e.path,
        s = e.query,
        u = e.fragment,
        c = t + ':'
      return (
        null !== o
          ? ((c += '//'),
            kc(e) && (c += n + (r ? ':' + r : '') + '@'),
            (c += Mc(o)),
            null !== i && (c += ':' + i))
          : 'file' == t && (c += '//'),
        (c += e.cannotBeABaseURL ? a[0] : a.length ? '/' + a.join('/') : ''),
        null !== s && (c += '?' + s),
        null !== u && (c += '#' + u),
        c
      )
    },
    ll = function() {
      var e = uc(this),
        t = e.scheme,
        n = e.port
      if ('blob' == t)
        try {
          return new URL(t.path[0]).origin
        } catch (kd) {
          return 'null'
        }
      return 'file' != t && Pc(e) ? t + '://' + Mc(e.host) + (null !== n ? ':' + n : '') : 'null'
    },
    pl = function() {
      return uc(this).scheme + ':'
    },
    hl = function() {
      return uc(this).username
    },
    fl = function() {
      return uc(this).password
    },
    gl = function() {
      var e = uc(this),
        t = e.host,
        n = e.port
      return null === t ? '' : null === n ? Mc(t) : Mc(t) + ':' + n
    },
    dl = function() {
      var e = uc(this).host
      return null === e ? '' : Mc(e)
    },
    ml = function() {
      var e = uc(this).port
      return null === e ? '' : String(e)
    },
    _l = function() {
      var e = uc(this),
        t = e.path
      return e.cannotBeABaseURL ? t[0] : t.length ? '/' + t.join('/') : ''
    },
    yl = function() {
      var e = uc(this).query
      return e ? '?' + e : ''
    },
    vl = function() {
      return uc(this).searchParams
    },
    El = function() {
      var e = uc(this).fragment
      return e ? '#' + e : ''
    },
    Sl = function(e, t) {
      return { get: e, set: t, configurable: !0, enumerable: !0 }
    }
  if (
    (i &&
      mt(ul, {
        href: Sl(cl, function(e) {
          var t = uc(this),
            n = String(e),
            r = al(t, n)
          if (r) throw TypeError(r)
          ac(t.searchParams).updateSearchParams(t.query)
        }),
        origin: Sl(ll),
        protocol: Sl(pl, function(e) {
          var t = uc(this)
          al(t, String(e) + ':', Fc)
        }),
        username: Sl(hl, function(e) {
          var t = uc(this),
            n = st(String(e))
          if (!Gc(t)) {
            t.username = ''
            for (var r = 0; r < n.length; r++) t.username += Rc(n[r], Nc)
          }
        }),
        password: Sl(fl, function(e) {
          var t = uc(this),
            n = st(String(e))
          if (!Gc(t)) {
            t.password = ''
            for (var r = 0; r < n.length; r++) t.password += Rc(n[r], Nc)
          }
        }),
        host: Sl(gl, function(e) {
          var t = uc(this)
          t.cannotBeABaseURL || al(t, String(e), zc)
        }),
        hostname: Sl(dl, function(e) {
          var t = uc(this)
          t.cannotBeABaseURL || al(t, String(e), Xc)
        }),
        port: Sl(ml, function(e) {
          var t = uc(this)
          Gc(t) || ('' == (e = String(e)) ? (t.port = null) : al(t, e, Jc))
        }),
        pathname: Sl(_l, function(e) {
          var t = uc(this)
          t.cannotBeABaseURL || ((t.path = []), al(t, e + '', tl))
        }),
        search: Sl(yl, function(e) {
          var t = uc(this)
          '' == (e = String(e))
            ? (t.query = null)
            : ('?' == e.charAt(0) && (e = e.slice(1)), (t.query = ''), al(t, e, ol)),
            ac(t.searchParams).updateSearchParams(t.query)
        }),
        searchParams: Sl(vl),
        hash: Sl(El, function(e) {
          var t = uc(this)
          '' != (e = String(e))
            ? ('#' == e.charAt(0) && (e = e.slice(1)), (t.fragment = ''), al(t, e, il))
            : (t.fragment = null)
        })
      }),
    Z(
      ul,
      'toJSON',
      function() {
        return cl.call(this)
      },
      { enumerable: !0 }
    ),
    Z(
      ul,
      'toString',
      function() {
        return cl.call(this)
      },
      { enumerable: !0 }
    ),
    oc)
  ) {
    var Il = oc.createObjectURL,
      Cl = oc.revokeObjectURL
    Il &&
      Z(sl, 'createObjectURL', function(e) {
        return Il.apply(oc, arguments)
      }),
      Cl &&
        Z(sl, 'revokeObjectURL', function(e) {
          return Cl.apply(oc, arguments)
        })
  }
  xt(sl, 'URL'), Ne({ global: !0, forced: !Su, sham: !i }, { URL: sl })
  var Tl = {
      JSON: {
        TYPE: {
          C2C: { NOTICE: 1, COMMON: 9, EVENT: 10 },
          GROUP: { COMMON: 3, TIP: 4, SYSTEM: 5, TIP2: 6 },
          FRIEND: { NOTICE: 7 },
          PROFILE: { NOTICE: 8 }
        },
        SUBTYPE: {
          C2C: { COMMON: 0, READED: 92, KICKEDOUT: 96 },
          GROUP: { COMMON: 0, LOVEMESSAGE: 1, TIP: 2, REDPACKET: 3 }
        },
        OPTIONS: {
          GROUP: {
            JOIN: 1,
            QUIT: 2,
            KICK: 3,
            SET_ADMIN: 4,
            CANCEL_ADMIN: 5,
            MODIFY_GROUP_INFO: 6,
            MODIFY_MEMBER_INFO: 7
          }
        }
      },
      PROTOBUF: {},
      IMAGE_TYPES: { ORIGIN: 1, LARGE: 2, SMALL: 3 },
      IMAGE_FORMAT: { JPG: 1, JPEG: 1, GIF: 2, PNG: 3, BMP: 4, UNKNOWN: 255 }
    },
    Ml = 1,
    Ol = 2,
    Al = 3,
    Dl = 4,
    Nl = 5,
    Rl = 7,
    Ll = 8,
    Pl = 9,
    kl = 10,
    Gl = 15,
    wl = 255,
    bl = 2,
    Ul = 0,
    xl = 1,
    Fl = {
      NICK: 'Tag_Profile_IM_Nick',
      GENDER: 'Tag_Profile_IM_Gender',
      BIRTHDAY: 'Tag_Profile_IM_BirthDay',
      LOCATION: 'Tag_Profile_IM_Location',
      SELFSIGNATURE: 'Tag_Profile_IM_SelfSignature',
      ALLOWTYPE: 'Tag_Profile_IM_AllowType',
      LANGUAGE: 'Tag_Profile_IM_Language',
      AVATAR: 'Tag_Profile_IM_Image',
      MESSAGESETTINGS: 'Tag_Profile_IM_MsgSettings',
      ADMINFORBIDTYPE: 'Tag_Profile_IM_AdminForbidType',
      LEVEL: 'Tag_Profile_IM_Level',
      ROLE: 'Tag_Profile_IM_Role'
    },
    ql = { UNKNOWN: 'Gender_Type_Unknown', FEMALE: 'Gender_Type_Female', MALE: 'Gender_Type_Male' },
    Vl = { NONE: 'AdminForbid_Type_None', SEND_OUT: 'AdminForbid_Type_SendOut' },
    Kl = {
      NEED_CONFIRM: 'AllowType_Type_NeedConfirm',
      ALLOW_ANY: 'AllowType_Type_AllowAny',
      DENY_ANY: 'AllowType_Type_DenyAny'
    },
    Bl = (function() {
      function e(t) {
        In(this, e),
          (this._imageMemoryURL = ''),
          (this._file = t.file),
          es
            ? this.createImageDataASURLInWXMiniApp(t.file)
            : this.createImageDataASURLInWeb(t.file),
          this._initImageInfoModel(),
          (this.type = an.MSG_IMAGE),
          (this._percent = 0),
          (this.content = {
            imageFormat: Tl.IMAGE_FORMAT[t.imageFormat] || Tl.IMAGE_FORMAT.UNKNOWN,
            uuid: t.uuid,
            imageInfoArray: []
          }),
          this.initImageInfoArray(t.imageInfoArray),
          (this._defaultImage =
            'http://imgcache.qq.com/open/qcloud/video/act/webim-images/default.jpg'),
          this._autoFixUrl()
      }
      return (
        Tn(e, [
          {
            key: '_initImageInfoModel',
            value: function() {
              var e = this
              ;(this._ImageInfoModel = function(t) {
                ;(this.instanceID = tu(9999999)),
                  (this.sizeType = t.type || 0),
                  (this.size = t.size || 0),
                  (this.width = t.width || 0),
                  (this.height = t.height || 0),
                  (this.imageUrl = t.url || ''),
                  (this.url = t.url || e._imageMemoryURL || e._defaultImage)
              }),
                (this._ImageInfoModel.prototype = {
                  setSizeType: function(e) {
                    this.sizeType = e
                  },
                  setImageUrl: function(e) {
                    e && (this.imageUrl = e)
                  },
                  getImageUrl: function() {
                    return this.imageUrl
                  }
                })
            }
          },
          {
            key: 'initImageInfoArray',
            value: function(e) {
              for (var t = 2, n = null, r = null; t >= 0; )
                (r =
                  void 0 === e || void 0 === e[t]
                    ? { type: 0, size: 0, width: 0, height: 0, url: '' }
                    : e[t]),
                  (n = new this._ImageInfoModel(r)).setSizeType(t + 1),
                  this.addImageInfo(n),
                  t--
            }
          },
          {
            key: 'updateImageInfoArray',
            value: function(e) {
              for (var t, n = this.content.imageInfoArray.length, r = 0; r < n; r++)
                (t = this.content.imageInfoArray[r]),
                  e.size && (t.size = e.size),
                  e.url && t.setImageUrl(e.url),
                  e.width && (t.width = e.width),
                  e.height && (t.height = e.height)
            }
          },
          {
            key: '_autoFixUrl',
            value: function() {
              for (
                var e = this.content.imageInfoArray.length,
                  t = '',
                  n = '',
                  r = ['http', 'https'],
                  o = null,
                  i = 0;
                i < e;
                i++
              )
                this.content.imageInfoArray[i].url &&
                  '' !== (o = this.content.imageInfoArray[i]).imageUrl &&
                  ((n = o.imageUrl.slice(0, o.imageUrl.indexOf('://') + 1)),
                  (t = o.imageUrl.slice(o.imageUrl.indexOf('://') + 1)),
                  r.indexOf(n) < 0 && (n = 'https:'),
                  this.content.imageInfoArray[i].setImageUrl([n, t].join('')))
            }
          },
          {
            key: 'updatePercent',
            value: function(e) {
              ;(this._percent = e), this._percent > 1 && (this._percent = 1)
            }
          },
          {
            key: 'updateImageFormat',
            value: function(e) {
              this.content.imageFormat = e
            }
          },
          {
            key: 'createImageDataASURLInWeb',
            value: function(e) {
              void 0 !== e &&
                e.files.length > 0 &&
                (this._imageMemoryURL = window.URL.createObjectURL(e.files[0]))
            }
          },
          {
            key: 'createImageDataASURLInWXMiniApp',
            value: function(e) {
              e && e.url && (this._imageMemoryURL = e.url)
            }
          },
          {
            key: 'replaceImageInfo',
            value: function(e, t) {
              this.content.imageInfoArray[t] instanceof this._ImageInfoModel ||
                (this.content.imageInfoArray[t] = e)
            }
          },
          {
            key: 'addImageInfo',
            value: function(e) {
              this.content.imageInfoArray.length >= 3 || this.content.imageInfoArray.push(e)
            }
          },
          {
            key: 'sendable',
            value: function() {
              return (
                0 !== this.content.imageInfoArray.length &&
                '' !== this.content.imageInfoArray[0].imageUrl &&
                  0 !== this.content.imageInfoArray[0].size
              )
            }
          }
        ]),
        e
      )
    })(),
    Hl = (function() {
      function e(t) {
        In(this, e), (this.type = an.MSG_FACE), (this.content = t || null)
      }
      return (
        Tn(e, [
          {
            key: 'sendable',
            value: function() {
              return null !== this.content
            }
          }
        ]),
        e
      )
    })(),
    jl = (function() {
      function e(t) {
        In(this, e),
          (this.type = an.MSG_AUDIO),
          (this._percent = 0),
          (this.content = {
            downloadFlag: 2,
            second: t.second,
            size: t.size,
            url: t.url,
            remoteAudioUrl: '',
            uuid: t.uuid
          })
      }
      return (
        Tn(e, [
          {
            key: 'updatePercent',
            value: function(e) {
              ;(this._percent = e), this._percent > 1 && (this._percent = 1)
            }
          },
          {
            key: 'updateAudioUrl',
            value: function(e) {
              this.content.remoteAudioUrl = e
            }
          },
          {
            key: 'sendable',
            value: function() {
              return '' !== this.content.remoteAudioUrl
            }
          }
        ]),
        e
      )
    })()
  Ne({ target: 'Object', stat: !0, forced: !i, sham: !i }, { defineProperty: D.f })
  var Yl = { from: !0, groupID: !0, groupName: !0, to: !0 },
    $l = (function() {
      function e(t) {
        In(this, e), (this.type = an.MSG_GRP_TIP), (this.content = {}), this._initContent(t)
      }
      return (
        Tn(e, [
          {
            key: '_initContent',
            value: function(e) {
              var t = this
              Object.keys(e).forEach(function(n) {
                switch (n) {
                  case 'remarkInfo':
                    break
                  case 'groupProfile':
                    ;(t.content.groupProfile = {}), t._initGroupProfile(e[n])
                    break
                  case 'operatorInfo':
                  case 'memberInfoList':
                    break
                  case 'msgMemberInfo':
                    ;(t.content.memberList = e[n]),
                      Object.defineProperty(t.content, 'msgMemberInfo', {
                        get: function() {
                          return (
                            Gs.warn(
                              '!!! 禁言的群提示消息中的 payload.msgMemberInfo 属性即将废弃，请使用 payload.memberList 属性替代。 \n',
                              'msgMemberInfo 中的 shutupTime 属性对应更改为 memberList 中的 muteTime 属性，表示禁言时长。 \n',
                              '参考：群提示消息 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/Message.html#.GroupTipPayload'
                            ),
                            t.content.memberList.map(function(e) {
                              return { userID: e.userID, shutupTime: e.muteTime }
                            })
                          )
                        }
                      })
                    break
                  default:
                    t.content[n] = e[n]
                }
              }),
                this.content.userIDList || (this.content.userIDList = [this.content.operatorID])
            }
          },
          {
            key: '_initGroupProfile',
            value: function(e) {
              for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                var r = t[n]
                Yl[r] && (this.content.groupProfile[r] = e[r])
              }
            }
          }
        ]),
        e
      )
    })(),
    Wl = { from: !0, groupID: !0, name: !0, to: !0 },
    zl = (function() {
      function e(t) {
        In(this, e), (this.type = an.MSG_GRP_SYS_NOTICE), (this.content = {}), this._initContent(t)
      }
      return (
        Tn(e, [
          {
            key: '_initContent',
            value: function(e) {
              var t = this
              Object.keys(e).forEach(function(n) {
                switch (n) {
                  case 'memberInfoList':
                    break
                  case 'remarkInfo':
                    t.content.handleMessage = e[n]
                    break
                  case 'groupProfile':
                    ;(t.content.groupProfile = {}), t._initGroupProfile(e[n])
                    break
                  default:
                    t.content[n] = e[n]
                }
              })
            }
          },
          {
            key: '_initGroupProfile',
            value: function(e) {
              for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                var r = t[n]
                Wl[r] && (this.content.groupProfile[r] = e[r])
              }
            }
          }
        ]),
        e
      )
    })(),
    Xl = Math.min,
    Jl = [].lastIndexOf,
    Ql = !!Jl && 1 / [1].lastIndexOf(1, -0) < 0,
    Zl = je('lastIndexOf'),
    ep =
      Ql || Zl
        ? function(e) {
            if (Ql) return Jl.apply(this, arguments) || 0
            var t = d(this),
              n = se(t.length),
              r = n - 1
            for (
              arguments.length > 1 && (r = Xl(r, ie(arguments[1]))), r < 0 && (r = n + r);
              r >= 0;
              r--
            )
              if (r in t && t[r] === e) return r || 0
            return -1
          }
        : Jl
  Ne({ target: 'Array', proto: !0, forced: ep !== [].lastIndexOf }, { lastIndexOf: ep })
  var tp = {
      70001: 'UserSig 已过期，请重新生成。建议 UserSig 有效期设置不小于24小时。',
      70002: 'UserSig 长度为0，请检查传入的 UserSig 是否正确。',
      70003: 'UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
      70005: 'UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
      70009: 'UserSig 验证失败，可能因为生成 UserSig 时混用了其他 SDKAppID 的私钥或密钥导致，请使用对应 SDKAppID 下的私钥或密钥重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
      70013: '请求中的 UserID 与生成 UserSig 时使用的 UserID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
      70014: '请求中的 SDKAppID 与生成 UserSig 时使用的 SDKAppID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
      70016: '密钥不存在，UserSig 验证失败，请在即时通信 IM 控制台获取密钥(https://cloud.tencent.com/document/product/269/32578#.E8.8E.B7.E5.8F.96.E5.AF.86.E9.92.A5)。',
      70020: 'SDKAppID 未找到，请在即时通信 IM 控制台确认应用信息。',
      70050: 'UserSig 验证次数过于频繁。请检查 UserSig 是否正确，并于1分钟后重新验证。您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
      70051: '帐号被拉入黑名单。',
      70052: 'UserSig 已经失效，请重新生成，再次尝试。',
      70107: '因安全原因被限制登录，请不要频繁登录。',
      70169: '请求的用户帐号不存在。',
      70114: '服务端内部超时，请稍后重试。',
      70202: '服务端内部超时，请稍后重试。',
      70206: '请求中批量数量不合法。',
      70402: '参数非法，请检查必填字段是否填充，或者字段的填充是否满足协议要求。',
      70403: '请求失败，需要 App 管理员权限。',
      70398: '帐号数超限。如需创建多于100个帐号，请将应用升级为专业版，具体操作指引请参见购买指引(https://cloud.tencent.com/document/product/269/32458)。',
      70500: '服务端内部错误，请稍后重试。',
      71e3: '删除帐号失败。仅支持删除体验版帐号，您当前应用为专业版，暂不支持帐号删除。',
      20001: '请求包非法。',
      20002: 'UserSig 或 A2 失效。',
      20003: '消息发送方或接收方 UserID 无效或不存在，请检查 UserID 是否已导入即时通信 IM。',
      20004: '网络异常，请重试。',
      20005: '服务端内部错误，请重试。',
      20006: '触发发送单聊消息之前回调，App 后台返回禁止下发该消息。',
      20007: '发送单聊消息，被对方拉黑，禁止发送。消息发送状态默认展示为失败，您可以登录控制台修改该场景下的消息发送状态展示结果，具体操作请参见消息保留设置(https://cloud.tencent.com/document/product/269/38656)。',
      20009: '消息发送双方互相不是好友，禁止发送（配置单聊消息校验好友关系才会出现）。',
      20010: '发送单聊消息，自己不是对方的好友（单向关系），禁止发送。',
      20011: '发送单聊消息，对方不是自己的好友（单向关系），禁止发送。',
      20012: '发送方被禁言，该条消息被禁止发送。',
      20016: '消息撤回超过了时间限制（默认2分钟）。',
      20018: '删除漫游内部错误。',
      90001: 'JSON 格式解析失败，请检查请求包是否符合 JSON 规范。',
      90002: 'JSON 格式请求包中 MsgBody 不符合消息格式描述，或者 MsgBody 不是 Array 类型，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。',
      90003: 'JSON 格式请求包体中缺少 To_Account 字段或者 To_Account 帐号不存在。',
      90005: 'JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型。',
      90006: 'JSON 格式请求包体中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型。',
      90007: 'JSON 格式请求包体中 MsgBody 类型不是 Array 类型，请将其修改为 Array 类型。',
      90008: 'JSON 格式请求包体中缺少 From_Account 字段或者 From_Account 帐号不存在。',
      90009: '请求需要 App 管理员权限。',
      90010: 'JSON 格式请求包不符合消息格式描述，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。',
      90011: '批量发消息目标帐号超过500，请减少 To_Account 中目标帐号数量。',
      90012: 'To_Account 没有注册或不存在，请确认 To_Account 是否导入即时通信 IM 或者是否拼写错误。',
      90026: '消息离线存储时间错误（最多不能超过7天）。',
      90031: 'JSON 格式请求包体中 SyncOtherMachine 字段不是 Integer 类型。',
      90044: 'JSON 格式请求包体中 MsgLifeTime 字段不是 Integer 类型。',
      90048: '请求的用户帐号不存在。',
      90054: '撤回请求中的 MsgKey 不合法。',
      90994: '服务内部错误，请重试。',
      90995: '服务内部错误，请重试。',
      91e3: '服务内部错误，请重试。',
      90992: '服务内部错误，请重试；如果所有请求都返回该错误码，且 App 配置了第三方回调，请检查 App 服务端是否正常向即时通信 IM 后台服务端返回回调结果。',
      93e3: 'JSON 数据包超长，消息包体请不要超过8k。',
      91101: 'Web 端长轮询被踢（Web 端同时在线实例个数超出限制）。',
      10002: '服务端内部错误，请重试。',
      10003: '请求中的接口名称错误，请核对接口名称并重试。',
      10004: '参数非法，请根据错误描述检查请求是否正确。',
      10005: '请求包体中携带的帐号数量过多。',
      10006: '操作频率限制，请尝试降低调用的频率。',
      10007: '操作权限不足，例如 Public 群组中普通成员尝试执行踢人操作，但只有 App 管理员才有权限。',
      10008: '请求非法，可能是请求中携带的签名信息验证不正确，请再次尝试。',
      10009: '该群不允许群主主动退出。',
      10010: '群组不存在，或者曾经存在过，但是目前已经被解散。',
      10011: '解析 JSON 包体失败，请检查包体的格式是否符合 JSON 格式。',
      10012: '发起操作的 UserID 非法，请检查发起操作的用户 UserID 是否填写正确。',
      10013: '被邀请加入的用户已经是群成员。',
      10014: '群已满员，无法将请求中的用户加入群组，如果是批量加人，可以尝试减少加入用户的数量。',
      10015: '群组 ID 非法，请检查群组 ID 是否填写正确。',
      10016: 'App 后台通过第三方回调拒绝本次操作。',
      10017: '因被禁言而不能发送消息，请检查发送者是否被设置禁言。',
      10018: '应答包长度超过最大包长（1MB），请求的内容过多，请尝试减少单次请求的数据量。',
      10019: '请求的用户帐号不存在。',
      10021: '群组 ID 已被使用，请选择其他的群组 ID。',
      10023: '发消息的频率超限，请延长两次发消息时间的间隔。',
      10024: '此邀请或者申请请求已经被处理。',
      10025: '群组 ID 已被使用，并且操作者为群主，可以直接使用。',
      10026: '该 SDKAppID 请求的命令字已被禁用。',
      10030: '请求撤回的消息不存在。',
      10031: '消息撤回超过了时间限制（默认2分钟）。',
      10032: '请求撤回的消息不支持撤回操作。',
      10033: '群组类型不支持消息撤回操作。',
      10034: '该消息类型不支持删除操作。',
      10035: '音视频聊天室和在线成员广播大群不支持删除消息。',
      10036: '音视频聊天室创建数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买预付费套餐“IM音视频聊天室”。',
      10037: '单个用户可创建和加入的群组数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“单人可创建与加入群组数”。',
      10038: '群成员数量超过限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“扩展群人数上限”。',
      10041: '该应用（SDKAppID）已配置不支持群消息撤回。'
    },
    np = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this))).code = e.code),
          (n.message = tp[e.code] || e.message),
          (n.data = e.data || {}),
          n
        )
      }
      return Dn(t, e), t
    })(Pn(Error)),
    rp = {
      NO_SDKAPPID: 2e3,
      NO_ACCOUNT_TYPE: 2001,
      NO_IDENTIFIER: 2002,
      NO_USERSIG: 2003,
      NO_SDK_INSTANCE: 2004,
      REQ_GET_ACCESS_LAYER_FAILED: 2020,
      REQ_LOGIN_FAILED: 2021,
      NO_TINYID: 2022,
      NO_A2KEY: 2023,
      NOT_LOGGED_IN: 2024,
      COS_UNDETECTED: 2040,
      MESSAGE_SEND_FAIL: 2100,
      MESSAGE_UNKNOW_ROMA_LIST_END_FLAG_FIELD: 2101,
      MESSAGE_ELEMENT_METHOD_UNDEFINED: 2102,
      MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS: 2103,
      MESSAGE_PARAMETER_MISSING_TO_ACCOUNT: 2104,
      MESSAGE_SEND_NEED_MESSAGE_INSTANCE: 2105,
      MESSAGE_SEND_INVALID_CONVERSATION_TYPE: 2106,
      MESSAGE_RESEND_FILE_UNSUPPORTED: 2107,
      MESSAGE_FILE_IS_EMPTY: 2108,
      MESSAGE_ONPROGRESS_FUNCTION_ERROR: 2109,
      MESSAGE_REVOKE_FAIL: 2110,
      MESSAGE_IMAGE_UPLOAD_FAIL: 2250,
      MESSAGE_IMAGE_SELECT_FILE_FIRST: 2251,
      MESSAGE_IMAGE_TYPES_LIMIT: 2252,
      MESSAGE_IMAGE_SIZE_LIMIT: 2253,
      MESSAGE_AUDIO_UPLOAD_FAIL: 2300,
      MESSAGE_AUDIO_SIZE_LIMIT: 2301,
      MESSAGE_VIDEO_UPLOAD_FAIL: 2350,
      MESSAGE_VIDEO_SIZE_LIMIT: 2351,
      MESSAGE_VIDEO_TYPES_LIMIT: 2352,
      MESSAGE_FILE_UPLOAD_FAIL: 2400,
      MESSAGE_FILE_SELECT_FILE_FIRST: 2401,
      MESSAGE_FILE_SIZE_LIMIT: 2402,
      MESSAGE_FILE_URL_IS_EMPTY: 2403,
      CONVERSATION_NOT_FOUND: 2500,
      USER_OR_GROUP_NOT_FOUND: 2501,
      CONVERSATION_UN_RECORDED_TYPE: 2502,
      ILLEGAL_GROUP_TYPE: 2600,
      CANNOT_JOIN_PRIVATE: 2601,
      CANNOT_CHANGE_OWNER_IN_AVCHATROOM: 2620,
      CANNOT_CHANGE_OWNER_TO_SELF: 2621,
      CANNOT_DISMISS_PRIVATE: 2622,
      JOIN_GROUP_FAIL: 2660,
      CANNOT_ADD_MEMBER_IN_AVCHATROOM: 2661,
      CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN: 2662,
      CANNOT_KICK_MEMBER_IN_AVCHATROOM: 2680,
      NOT_OWNER: 2681,
      CANNOT_SET_MEMBER_ROLE_IN_PRIVATE_AND_AVCHATROOM: 2682,
      INVALID_MEMBER_ROLE: 2683,
      CANNOT_SET_SELF_MEMBER_ROLE: 2684,
      CANNOT_MUTE_SELF: 2685,
      DEL_FRIEND_INVALID_PARAM: 2700,
      UPDATE_PROFILE_INVALID_PARAM: 2721,
      UPDATE_PROFILE_NO_KEY: 2722,
      ADD_BLACKLIST_INVALID_PARAM: 2740,
      DEL_BLACKLIST_INVALID_PARAM: 2741,
      CANNOT_ADD_SELF_TO_BLACKLIST: 2742,
      NETWORK_ERROR: 2800,
      NETWORK_TIMEOUT: 2801,
      NETWORK_BASE_OPTIONS_NO_URL: 2802,
      NETWORK_UNDEFINED_SERVER_NAME: 2803,
      NETWORK_PACKAGE_UNDEFINED: 2804,
      NO_NETWORK: 2805,
      SOCKET_NOT_SUPPORTED: 2850,
      CONVERTOR_IRREGULAR_PARAMS: 2900,
      NOTICE_RUNLOOP_UNEXPECTED_CONDITION: 2901,
      NOTICE_RUNLOOP_OFFSET_LOST: 2902,
      UNCAUGHT_ERROR: 2903,
      GET_LONGPOLL_ID_FAILED: 2904,
      SDK_IS_NOT_READY: 2999,
      SSO_LOG_MODEL_INIT_ERROR: 3e3,
      LONG_POLL_KICK_OUT: 91101,
      MESSAGE_A2KEY_EXPIRED: 20002,
      ACCOUNT_A2KEY_EXPIRED: 70001,
      LONG_POLL_API_PARAM_ERROR: 90001
    },
    op = {
      NO_SDKAPPID: '无 SDKAppID',
      NO_ACCOUNT_TYPE: '无 accountType',
      NO_IDENTIFIER: '无 userID',
      NO_USERSIG: '无 usersig',
      NO_SDK_INSTANCE: '无 SDK 实例',
      REQ_GET_ACCESS_LAYER_FAILED: '获取沙箱请求失败',
      REQ_LOGIN_FAILED: '登录请求失败',
      NO_TINYID: '无tinyid',
      NO_A2KEY: '无a2key',
      NOT_LOGGED_IN: '未登录',
      COS_UNDETECTED: '未检测到 COS 上传插件',
      MESSAGE_SEND_FAIL: '消息发送失败',
      MESSAGE_UNKNOW_ROMA_LIST_END_FLAG_FIELD: '未知的漫游消息结束字段',
      MESSAGE_ELEMENT_METHOD_UNDEFINED: '消息元素未创建，因为方法未定义',
      MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS: 'MessageController.constructor() 需要参数 options',
      MESSAGE_PARAMETER_MISSING_TO_ACCOUNT: '需要 toAccount 参数',
      MESSAGE_SEND_NEED_MESSAGE_INSTANCE: '需要 Message 的实例',
      MESSAGE_SEND_INVALID_CONVERSATION_TYPE: 'Message.conversationType 只能为 "C2C"或"GROUP" ',
      MESSAGE_RESEND_FILE_UNSUPPORTED: '文件类消息不能使用 SDK.resendMessage() 函数重发',
      MESSAGE_FILE_IS_EMPTY: '无法发送空文件',
      MESSAGE_ONPROGRESS_FUNCTION_ERROR: '回调函数运行时遇到错误，请检查接入侧代码',
      MESSAGE_REVOKE_FAIL: '消息撤回失败',
      MESSAGE_IMAGE_UPLOAD_FAIL: '图片上传失败',
      MESSAGE_IMAGE_SELECT_FILE_FIRST: '请先选择一个图片',
      MESSAGE_IMAGE_TYPES_LIMIT: '只允许上传 jpg png jpeg gif 格式的图片',
      MESSAGE_IMAGE_SIZE_LIMIT: '图片大小超过20M，无法发送',
      MESSAGE_AUDIO_UPLOAD_FAIL: '语音上传失败',
      MESSAGE_AUDIO_SIZE_LIMIT: '语音大小大于20M，无法发送',
      MESSAGE_VIDEO_UPLOAD_FAIL: '视频上传失败',
      MESSAGE_VIDEO_SIZE_LIMIT: '视频大小超过20M，无法发送',
      MESSAGE_VIDEO_TYPES_LIMIT: '只允许上传 mp4 格式的视频',
      MESSAGE_FILE_UPLOAD_FAIL: '文件上传失败',
      MESSAGE_FILE_SELECT_FILE_FIRST: '请先选择一个文件',
      MESSAGE_FILE_SIZE_LIMIT: '文件大小超过100M，无法发送 ',
      MESSAGE_FILE_URL_IS_EMPTY: '缺少必要的参数文件 URL',
      CONVERSATION_NOT_FOUND: '没有找到相应的会话，请检查传入参数',
      USER_OR_GROUP_NOT_FOUND: '没有找到相应的用户或群组，请检查传入参数',
      CONVERSATION_UN_RECORDED_TYPE: '未记录的会话类型',
      ILLEGAL_GROUP_TYPE: '非法的群类型，请检查传入参数',
      CANNOT_JOIN_PRIVATE: '不能加入 Private 类型的群组',
      CANNOT_CHANGE_OWNER_IN_AVCHATROOM: 'AVChatRoom 类型的群组不能转让群主',
      CANNOT_CHANGE_OWNER_TO_SELF: '不能把群主转让给自己',
      CANNOT_DISMISS_PRIVATE: '不能解散 Private 类型的群组',
      JOIN_GROUP_FAIL: '加群失败，请检查传入参数或重试',
      CANNOT_ADD_MEMBER_IN_AVCHATROOM: 'AVChatRoom 类型的群不支持邀请群成员',
      CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:
        '非 AVChatRoom 类型的群组不允许匿名加群，请先登录后再加群',
      CANNOT_KICK_MEMBER_IN_AVCHATROOM: '不能在 AVChatRoom 类型的群组踢人',
      NOT_OWNER: '你不是群主，只有群主才有权限操作',
      CANNOT_SET_MEMBER_ROLE_IN_PRIVATE_AND_AVCHATROOM:
        '不能在 Private / AVChatRoom 类型的群中设置群成员身份',
      INVALID_MEMBER_ROLE: '不合法的群成员身份，请检查传入参数',
      CANNOT_SET_SELF_MEMBER_ROLE: '不能设置自己的群成员身份，请检查传入参数',
      CANNOT_MUTE_SELF: '不能将自己禁言，请检查传入参数',
      DEL_FRIEND_INVALID_PARAM: '传入 deleteFriend 接口的参数无效',
      UPDATE_PROFILE_INVALID_PARAM: '传入 updateMyProfile 接口的参数无效',
      UPDATE_PROFILE_NO_KEY: 'updateMyProfile 无标配资料字段或自定义资料字段',
      ADD_BLACKLIST_INVALID_PARAM: '传入 addToBlacklist 接口的参数无效',
      DEL_BLACKLIST_INVALID_PARAM: '传入 removeFromBlacklist 接口的参数无效',
      CANNOT_ADD_SELF_TO_BLACKLIST: '不能拉黑自己',
      NETWORK_ERROR: '网络错误',
      NETWORK_TIMEOUT: '请求超时',
      NETWORK_BASE_OPTIONS_NO_URL: '网络层初始化错误，缺少 URL 参数',
      NETWORK_UNDEFINED_SERVER_NAME: '打包错误，未定义的 serverName',
      NETWORK_PACKAGE_UNDEFINED: '未定义的 packageConfig',
      NO_NETWORK: '未连接到网络',
      SOCKET_NOT_SUPPORTED: '当前浏览器不支持 WebSocket',
      CONVERTOR_IRREGULAR_PARAMS: '不规范的参数名称',
      NOTICE_RUNLOOP_UNEXPECTED_CONDITION: '意料外的通知条件',
      NOTICE_RUNLOOP_OFFSET_LOST: '_syncOffset 丢失',
      GET_LONGPOLL_ID_FAILED: '获取 longpolling id 失败',
      UNCAUGHT_ERROR: '未经明确定义的错误',
      SDK_IS_NOT_READY: '接口需要 SDK 处于 ready 状态后才能调用',
      LONG_POLL_KICK_OUT: '检测到多个 web 实例登录，消息通道下线',
      SSO_LOG_MODEL_INIT_ERROR: 'SSOLogData 数据模型初始化错误',
      MESSAGE_A2KEY_EXPIRED: '消息错误码：UserSig 或 A2 失效。',
      ACCOUNT_A2KEY_EXPIRED:
        '帐号错误码：UserSig 已过期，请重新生成。建议 UserSig 有效期设置不小于24小时。',
      LONG_POLL_API_PARAM_ERROR: 'longPoll API parameters error'
    },
    ip = ['jpg', 'jpeg', 'gif', 'png'],
    ap = ['mp4'],
    sp = (function() {
      function e(t) {
        In(this, e)
        var n = this._check(t)
        if (n instanceof np) throw n
        ;(this.type = an.MSG_FILE), (this._percent = 0)
        var r = this._getFileInfo(t)
        this.content = {
          downloadFlag: 2,
          fileUrl: t.url || '',
          uuid: t.uuid,
          fileName: r.name || '',
          fileSize: r.size || 0
        }
      }
      return (
        Tn(e, [
          {
            key: '_getFileInfo',
            value: function(e) {
              if (e.fileName && e.fileSize) return { size: e.fileSize, name: e.fileName }
              if (es) return {}
              var t = e.file.files[0]
              return {
                size: t.size,
                name: t.name,
                type: t.type.slice(t.type.lastIndexOf('/') + 1).toLowerCase()
              }
            }
          },
          {
            key: 'updatePercent',
            value: function(e) {
              ;(this._percent = e), this._percent > 1 && (this._percent = 1)
            }
          },
          {
            key: 'updateFileUrl',
            value: function(e) {
              this.content.fileUrl = e
            }
          },
          {
            key: '_check',
            value: function(e) {
              if (e.size > 104857600)
                return new np({
                  code: rp.MESSAGE_FILE_SIZE_LIMIT,
                  message: ''.concat(op.MESSAGE_FILE_SIZE_LIMIT, ': ').concat(104857600, ' bytes')
                })
            }
          },
          {
            key: 'sendable',
            value: function() {
              return (
                '' !== this.content.fileUrl &&
                '' !== this.content.fileName && 0 !== this.content.fileSize
              )
            }
          }
        ]),
        e
      )
    })(),
    up = (function() {
      function e(t) {
        In(this, e),
          (this.type = an.MSG_CUSTOM),
          (this.content = {
            data: t.data || '',
            description: t.description || '',
            extension: t.extension || ''
          })
      }
      return (
        Tn(e, [
          {
            key: 'setData',
            value: function(e) {
              return (this.content.data = e), this
            }
          },
          {
            key: 'setDescription',
            value: function(e) {
              return (this.content.description = e), this
            }
          },
          {
            key: 'setExtension',
            value: function(e) {
              return (this.content.extension = e), this
            }
          },
          {
            key: 'sendable',
            value: function() {
              return (
                0 !== this.content.data.length ||
                0 !== this.content.description.length ||
                0 !== this.content.extension.length
              )
            }
          }
        ]),
        e
      )
    })(),
    cp = (function() {
      function e(t) {
        In(this, e),
          (this.type = an.MSG_VIDEO),
          (this._percent = 0),
          (this.content = {
            remoteVideoUrl: t.remoteVideoUrl,
            videoFormat: t.videoFormat,
            videoSecond: parseInt(t.videoSecond, 10),
            videoSize: t.videoSize,
            videoUrl: t.videoUrl,
            videoDownloadFlag: 2,
            videoUUID: t.videoUUID,
            thumbUUID: t.thumbUUID,
            thumbFormat: t.thumbFormat,
            thumbWidth: t.thumbWidth,
            thumbHeight: t.thumbHeight,
            thumbSize: t.thumbSize,
            thumbDownloadFlag: 2,
            thumbUrl: t.thumbUrl
          })
      }
      return (
        Tn(e, [
          {
            key: 'updatePercent',
            value: function(e) {
              ;(this._percent = e), this._percent > 1 && (this._percent = 1)
            }
          },
          {
            key: 'updateVideoUrl',
            value: function(e) {
              e && (this.content.remoteVideoUrl = e)
            }
          },
          {
            key: 'sendable',
            value: function() {
              return '' !== this.content.remoteVideoUrl
            }
          }
        ]),
        e
      )
    })(),
    lp = function e(t) {
      In(this, e), (this.type = an.MSG_GEO), (this.content = t)
    },
    pp = (function() {
      function e(t) {
        In(this, e),
          (this.ID = ''),
          (this.conversationID = t.conversationID || null),
          (this.conversationType = t.conversationType || an.CONV_C2C),
          (this.conversationSubType = t.conversationSubType),
          (this.time = t.time || Math.ceil(Date.now() / 1e3)),
          (this.sequence = t.sequence || 0),
          (this.clientSequence = t.clientSequence || t.sequence || 0),
          (this.random = t.random || tu()),
          (this.messagePriority = t.messagePriority || 0),
          (this._elements = []),
          (this.isPlaceMessage = t.isPlaceMessage || 0),
          (this.isRevoked = 2 === t.isPlaceMessage || 8 === t.msgFlagBits),
          (this.geo = {}),
          (this.from = t.from || null),
          (this.to = t.to || null),
          (this.flow = ''),
          (this.isSystemMessage = t.isSystemMessage || !1),
          (this.protocol = t.protocol || 'JSON'),
          (this.isResend = !1),
          (this.isRead = !1),
          (this.status = t.status || yu.MESSAGE_STATUS.SUCCESS),
          this.reInitialize(t.currentUser),
          this.extractGroupInfo(t.groupProfile || null)
      }
      return (
        Tn(e, [
          {
            key: 'getElements',
            value: function() {
              return this._elements
            }
          },
          {
            key: 'extractGroupInfo',
            value: function(e) {
              if (null !== e) {
                var t = e.messageFromAccountExtraInformation
                ;(this.nick = ''),
                  'string' == typeof e.fromAccountNick && (this.nick = e.fromAccountNick),
                  (this.avatar = ''),
                  'string' == typeof e.fromAccountHeadurl && (this.avatar = e.fromAccountHeadurl),
                  (this.nameCard = ''),
                  'object' === Sn(t) && t.hasOwnProperty('nameCard') && (this.nameCard = t.nameCard)
              }
            }
          },
          {
            key: '_initProxy',
            value: function() {
              ;(this.payload = this._elements[0].content), (this.type = this._elements[0].type)
            }
          },
          {
            key: 'reInitialize',
            value: function(e) {
              e &&
                ((this.status = this.from ? yu.MESSAGE_STATUS.SUCCESS : yu.MESSAGE_STATUS.UNSEND),
                !this.from && (this.from = e)),
                this._initFlow(e),
                this._initielizeSequence(e),
                this._concactConversationID(e),
                this.generateMessageID(e)
            }
          },
          {
            key: 'isSendable',
            value: function() {
              return (
                0 !== this._elements.length &&
                ('function' != typeof this._elements[0].sendable
                  ? (Gs.warn(
                      ''.concat(this._elements[0].type, ' need "boolean : sendable()" method')
                    ),
                    !1)
                  : this._elements[0].sendable())
              )
            }
          },
          {
            key: '_initTo',
            value: function(e) {
              this.conversationType === an.CONV_GROUP && (this.to = e.groupID)
            }
          },
          {
            key: '_initielizeSequence',
            value: function(e) {
              0 === this.clientSequence &&
                e &&
                (this.clientSequence = (function(e) {
                  if (!e) return Gs.error('autoincrementIndex(string: key) need key parameter'), !1
                  if (void 0 === iu[e]) {
                    var t = new Date(),
                      n = '3'.concat(t.getHours()).slice(-2),
                      r = '0'.concat(t.getMinutes()).slice(-2),
                      o = '0'.concat(t.getSeconds()).slice(-2)
                    ;(iu[e] = parseInt([n, r, o, '0001'].join(''))),
                      (n = null),
                      (r = null),
                      (o = null),
                      Gs.warn(
                        'utils.autoincrementIndex() create new sequence : '
                          .concat(e, ' = ')
                          .concat(iu[e])
                      )
                  }
                  return iu[e]++
                })(e)),
                0 === this.sequence &&
                  this.conversationType === an.CONV_C2C &&
                  (this.sequence = this.clientSequence)
            }
          },
          {
            key: 'generateMessageID',
            value: function(e) {
              var t = e === this.from ? 1 : 0,
                n = this.sequence > 0 ? this.sequence : this.clientSequence
              this.ID = ''
                .concat(this.conversationID, '-')
                .concat(n, '-')
                .concat(this.random, '-')
                .concat(t)
            }
          },
          {
            key: '_initFlow',
            value: function(e) {
              '' !== e &&
                (e === this.from ? ((this.flow = 'out'), (this.isRead = !0)) : (this.flow = 'in'))
            }
          },
          {
            key: '_concactConversationID',
            value: function(e) {
              var t = this.to,
                n = '',
                r = this.conversationType
              r !== an.CONV_SYSTEM
                ? ((n = r === an.CONV_C2C ? (e === this.from ? t : this.from) : this.to),
                  (this.conversationID = ''.concat(r).concat(n)))
                : (this.conversationID = an.CONV_SYSTEM)
            }
          },
          {
            key: 'isElement',
            value: function(e) {
              return (
                e instanceof vu ||
                e instanceof Bl ||
                e instanceof Hl ||
                e instanceof jl ||
                e instanceof sp ||
                e instanceof cp ||
                e instanceof $l ||
                e instanceof zl ||
                e instanceof up ||
                e instanceof lp
              )
            }
          },
          {
            key: 'setElement',
            value: function(e) {
              var t = this
              if (this.isElement(e)) return (this._elements = [e]), void this._initProxy()
              var n = function(e) {
                switch (e.type) {
                  case an.MSG_TEXT:
                    t.setTextElement(e.content)
                    break
                  case an.MSG_IMAGE:
                    t.setImageElement(e.content)
                    break
                  case an.MSG_AUDIO:
                    t.setAudioElement(e.content)
                    break
                  case an.MSG_FILE:
                    t.setFileElement(e.content)
                    break
                  case an.MSG_VIDEO:
                    t.setVideoElement(e.content)
                    break
                  case an.MSG_CUSTOM:
                    t.setCustomElement(e.content)
                    break
                  case an.MSG_GEO:
                    t.setGEOElement(e.content)
                    break
                  case an.MSG_GRP_TIP:
                    t.setGroupTipElement(e.content)
                    break
                  case an.MSG_GRP_SYS_NOTICE:
                    t.setGroupSystemNoticeElement(e.content)
                    break
                  case an.MSG_FACE:
                    t.setFaceElement(e.content)
                    break
                  default:
                    Gs.warn(e.type, e.content, 'no operation......')
                }
              }
              if (Array.isArray(e)) for (var r = 0; r < e.length; r++) n(e[r])
              else n(e)
              this._initProxy()
            }
          },
          {
            key: 'setTextElement',
            value: function(e) {
              var t = 'string' == typeof e ? e : e.text,
                n = new vu({ text: t })
              this._elements.push(n)
            }
          },
          {
            key: 'setImageElement',
            value: function(e) {
              var t = new Bl(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setAudioElement',
            value: function(e) {
              var t = new jl(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setFileElement',
            value: function(e) {
              var t = new sp(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setVideoElement',
            value: function(e) {
              var t = new cp(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setGEOElement',
            value: function(e) {
              var t = new lp(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setCustomElement',
            value: function(e) {
              var t = new up(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setGroupTipElement',
            value: function(e) {
              var t = new $l(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setGroupSystemNoticeElement',
            value: function(e) {
              var t = new zl(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setFaceElement',
            value: function(e) {
              var t = new Hl(e)
              this._elements.push(t)
            }
          },
          {
            key: 'setIsRead',
            value: function(e) {
              this.isRead = e
            }
          },
          {
            key: 'elements',
            get: function() {
              return (
                Gs.warn(
                  '！！！Message 实例的 elements 属性即将废弃，请尽快修改。使用 type 和 payload 属性处理单条消息，兼容组合消息使用 _elements 属性！！！'
                ),
                this._elements
              )
            }
          }
        ]),
        e
      )
    })(),
    hp = {
      login: {
        userID: { type: 'String', required: !0 },
        userSig: { type: 'String', required: !0 }
      },
      addToBlacklist: { userIDList: { type: 'Array', required: !0 } },
      mutilParam: [
        { name: 'paramName', type: 'Number', required: !0 },
        { name: 'paramName', type: 'String', required: !0 }
      ],
      on: [
        {
          name: 'eventName',
          type: 'String',
          validator: function(e) {
            return (
              ('string' == typeof e && 0 !== e.length) ||
              (console.warn('on 接口的 eventName 参数必须是 String 类型，且不能为空。'), !1)
            )
          }
        },
        {
          name: 'handler',
          type: 'Function',
          validator: function(e) {
            return 'function' != typeof e
              ? (console.warn('on 接口的 handler 参数必须是 Function 类型。'), !1)
              : ('' === e.name &&
                  console.warn(
                    'on 接口的 handler 参数推荐使用具名函数。具名函数可以使用 off 接口取消订阅，匿名函数无法取消订阅。'
                  ),
                !0)
          }
        }
      ],
      once: [
        {
          name: 'eventName',
          type: 'String',
          validator: function(e) {
            return (
              ('string' == typeof e && 0 !== e.length) ||
              (console.warn('once 接口的 eventName 参数必须是 String 类型，且不能为空。'), !1)
            )
          }
        },
        {
          name: 'handler',
          type: 'Function',
          validator: function(e) {
            return 'function' != typeof e
              ? (console.warn('once 接口的 handler 参数必须是 Function 类型。'), !1)
              : ('' === e.name && console.warn('once 接口的 handler 参数推荐使用具名函数。'), !0)
          }
        }
      ],
      off: [
        {
          name: 'eventName',
          type: 'String',
          validator: function(e) {
            return (
              ('string' == typeof e && 0 !== e.length) ||
              (console.warn('off 接口的 eventName 参数必须是 String 类型，且不能为空。'), !1)
            )
          }
        },
        {
          name: 'handler',
          type: 'Function',
          validator: function(e) {
            return 'function' != typeof e
              ? (console.warn('off 接口的 handler 参数必须是 Function 类型。'), !1)
              : ('' === e.name && console.warn('off 接口的 handler 参数为匿名函数，无法取消订阅。'),
                !0)
          }
        }
      ],
      sendMessage: [{ name: 'message', type: 'Object', required: !0 }],
      getMessageList: {
        conversationID: { type: 'String', required: !0 },
        nextReqMessageID: { type: 'String' },
        count: {
          type: 'Number',
          validator: function(e) {
            return (
              !(!Bs(e) && !/^[1-9][0-9]*$/.test(e)) ||
              (console.warn('getMessageList 接口的 count 参数必须为正整数'), !1)
            )
          }
        }
      },
      getConversationProfile: [
        {
          name: 'conversationID',
          type: 'String',
          required: !0,
          validator: function(e) {
            return (
              !!e &&
              (!!(
                (Fs((t = e)) && t.slice(0, 3) === an.CONV_C2C) ||
                (function(e) {
                  return Fs(e) && e.slice(0, 5) === an.CONV_GROUP
                })(e) ||
                pu(e)
              ) ||
                (console.warn(
                  '非法的会话 ID:'.concat(
                    e,
                    '。会话 ID 组成方式：\n      C2C + userID（单聊）\n      GROUP + groupID（群聊）\n      @TIM#SYSTEM（系统通知会话）'
                  )
                ),
                !1))
            )
            var t
          }
        }
      ],
      deleteConversation: [{ name: 'conversationID', type: 'String', required: !0 }],
      getGroupList: { groupProfileFilter: { type: 'Array' } },
      getGroupProfile: {
        groupID: { type: 'String', required: !0 },
        groupCustomFieldFilter: { type: 'Array' },
        memberCustomFieldFilter: { type: 'Array' }
      },
      getGroupProfileAdvance: { groupIDList: { type: 'Array', required: !0 } },
      createGroup: { name: { type: 'String', required: !0 } },
      joinGroup: {
        groupID: { type: 'String', required: !0 },
        type: { type: 'String' },
        applyMessage: { type: 'String' }
      },
      quitGroup: [{ name: 'groupID', type: 'String', required: !0 }],
      handleApplication: {
        message: { type: 'Object', required: !0 },
        handleAction: { type: 'String', required: !0 },
        handleMessage: { type: 'String' }
      },
      changeGroupOwner: {
        groupID: { type: 'String', required: !0 },
        newOwnerID: { type: 'String', required: !0 }
      },
      updateGroupProfile: { groupID: { type: 'String', required: !0 } },
      dismissGroup: [{ name: 'groupID', type: 'String', required: !0 }],
      searchGroupByID: [{ name: 'groupID', type: 'String', required: !0 }],
      getGroupMemberList: {
        groupID: { type: 'String', required: !0 },
        offset: { type: 'Number' },
        count: { type: 'Number' }
      },
      getGroupMemberProfile: {
        groupID: { type: 'String', required: !0 },
        userIDList: { type: 'Array', required: !0 },
        memberCustomFieldFilter: { type: 'Array' }
      },
      addGroupMemeber: {
        groupID: { type: 'String', required: !0 },
        userIDList: { type: 'Array', required: !0 }
      },
      setGroupMemberRole: {
        groupID: { type: 'String', required: !0 },
        userID: { type: 'String', required: !0 },
        role: { type: 'String', required: !0 }
      },
      setGroupMemberMuteTime: {
        groupID: { type: 'String', required: !0 },
        userID: { type: 'String', required: !0 },
        muteTime: {
          type: 'Number',
          validator: function(e) {
            return e >= 0
          }
        }
      },
      setGroupMemberNameCard: {
        groupID: { type: 'String', required: !0 },
        userID: { type: 'String' },
        nameCard: {
          type: 'String',
          required: !0,
          validator: function(e) {
            return !0 !== /^\s+$/.test(e)
          }
        }
      },
      setMessageRemindType: {
        groupID: { type: 'String', required: !0 },
        messageRemindType: { type: 'String', required: !0 }
      },
      setGroupMemberCustomField: {
        groupID: { type: 'String', required: !0 },
        userID: { type: 'String' },
        memberCustomField: { type: 'Array', required: !0 }
      },
      deleteGroupMember: { groupID: { type: 'String', required: !0 } },
      createTextMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: {
          type: 'Object',
          required: !0,
          validator: function(e) {
            return Fs(e.text)
              ? 0 !== e.text.length ||
                  (console.warn(
                    'createTextMessage 消息内容不能为空。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createTextMessage'
                  ),
                  !1)
              : (console.warn(
                  'createTextMessage payload.text 类型必须为字符串。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createTextMessage'
                ),
                !1)
          }
        }
      },
      createCustomMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: { type: 'Object', required: !0 }
      },
      createImageMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: {
          type: 'Object',
          required: !0,
          validator: function(e) {
            if (Bs(e.file))
              return (
                console.warn(
                  'createImageMessage payload.file 不能为 undefined。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                ),
                !1
              )
            if (Za) {
              if (!(e.file instanceof HTMLInputElement || Us(e.file)))
                return (
                  console.warn(
                    'createImageMessage payload.file 的类型必须是 HTMLInputElement 或 File。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                  ),
                  !1
                )
              if (e.file instanceof HTMLInputElement && 0 === e.file.files.length)
                return (
                  console.warn(
                    'createImageMessage 您没有选择文件，无法发送。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                  ),
                  !1
                )
            }
            return !0
          },
          onProgress: {
            type: 'Function',
            required: !1,
            validator: function(e) {
              return (
                Bs(e) &&
                  console.warn(
                    'createImageMessage 没有 onProgress 回调，您将无法获取图片上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                  ),
                !0
              )
            }
          }
        }
      },
      createAudioMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: { type: 'Object', required: !0 },
        onProgress: {
          type: 'Function',
          required: !1,
          validator: function(e) {
            return (
              Bs(e) &&
                console.warn(
                  'createAudioMessage 没有 onProgress 回调，您将无法获取音频上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createAudioMessage'
                ),
              !0
            )
          }
        }
      },
      createVideoMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: { type: 'Object', required: !0 },
        onProgress: {
          type: 'Function',
          required: !1,
          validator: function(e) {
            return (
              Bs(e) &&
                console.warn(
                  'createVideoMessage 没有 onProgress 回调，您将无法获取视频上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createVideoMessage'
                ),
              !0
            )
          }
        }
      },
      createFaceMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: {
          type: 'Object',
          required: !0,
          validator: function(e) {
            return (
              !!Vs(e) &&
              (xs(e.index)
                ? !!Fs(e.data) ||
                  (console.warn('createFaceMessage payload.data 类型必须为 String！'), !1)
                : (console.warn('createFaceMessage payload.index 类型必须为 Number！'), !1))
            )
          }
        }
      },
      createFileMessage: {
        to: { type: 'String', required: !0 },
        conversationType: { type: 'String', required: !0 },
        payload: {
          type: 'Object',
          required: !0,
          validator: function(e) {
            if (Bs(e.file))
              return (
                console.warn(
                  'createFileMessage payload.file 不能为 undefined。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                ),
                !1
              )
            if (Za) {
              if (!(e.file instanceof HTMLInputElement || Us(e.file)))
                return (
                  console.warn(
                    'createFileMessage payload.file 的类型必须是 HTMLInputElement 或 File。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                  ),
                  !1
                )
              if (e.file instanceof HTMLInputElement && 0 === e.file.files.length)
                return (
                  console.warn(
                    'createFileMessage 您没有选择文件，无法发送。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                  ),
                  !1
                )
            }
            return !0
          }
        },
        onProgress: {
          type: 'Function',
          required: !1,
          validator: function(e) {
            return (
              Bs(e) &&
                console.warn(
                  'createFileMessage 没有 onProgress 回调，您将无法获取文件上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                ),
              !0
            )
          }
        }
      },
      revokeMessage: [
        {
          name: 'message',
          type: 'Object',
          required: !0,
          validator: function(e) {
            return e instanceof pp
              ? e.conversationType === an.CONV_SYSTEM
                ? (console.warn('revokeMessage 不能撤回系统会话消息，只能撤回单聊消息或群消息'), !1)
                : !0 !== e.isRevoked ||
                  (console.warn('revokeMessage 消息已经被撤回，请勿重复操作'), !1)
              : (console.warn(
                  'revokeMessage 参数 message 必须为 Message(https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/Message.html) 实例。'
                ),
                !1)
          }
        }
      ],
      getUserProfile: {
        userIDList: {
          type: 'Array',
          validator: function(e) {
            return Ks(e)
              ? (0 === e.length &&
                  console.warn(
                    'getUserProfile userIDList 不能为空数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#getUserProfile'
                  ),
                !0)
              : (console.warn(
                  'getUserProfile userIDList 必须为数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#getUserProfile'
                ),
                !1)
          }
        }
      },
      updateMyProfile: {
        profileCustomField: {
          type: 'Array',
          validator: function(e) {
            return (
              !!Bs(e) ||
              !!Ks(e) ||
                (console.warn(
                  'updateMyProfile profileCustomField 必须为数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile'
                ),
                !1)
            )
          }
        }
      }
    },
    fp = {
      login: 'login',
      logout: 'logout',
      on: 'on',
      once: 'once',
      off: 'off',
      setLogLevel: 'setLogLevel',
      downloadLog: 'downloadLog',
      registerPlugin: 'registerPlugin',
      destroy: 'destroy',
      createTextMessage: 'createTextMessage',
      createImageMessage: 'createImageMessage',
      createAudioMessage: 'createAudioMessage',
      createVideoMessage: 'createVideoMessage',
      createCustomMessage: 'createCustomMessage',
      createFaceMessage: 'createFaceMessage',
      createFileMessage: 'createFileMessage',
      sendMessage: 'sendMessage',
      resendMessage: 'resendMessage',
      getMessageList: 'getMessageList',
      setMessageRead: 'setMessageRead',
      revokeMessage: 'revokeMessage',
      getConversationList: 'getConversationList',
      getConversationProfile: 'getConversationProfile',
      deleteConversation: 'deleteConversation',
      getGroupList: 'getGroupList',
      getGroupProfile: 'getGroupProfile',
      createGroup: 'createGroup',
      joinGroup: 'joinGroup',
      updateGroupProfile: 'updateGroupProfile',
      quitGroup: 'quitGroup',
      dismissGroup: 'dismissGroup',
      changeGroupOwner: 'changeGroupOwner',
      searchGroupByID: 'searchGroupByID',
      setMessageRemindType: 'setMessageRemindType',
      handleGroupApplication: 'handleGroupApplication',
      getGroupMemberProfile: 'getGroupMemberProfile',
      getGroupMemberList: 'getGroupMemberList',
      addGroupMember: 'addGroupMember',
      deleteGroupMember: 'deleteGroupMember',
      setGroupMemberNameCard: 'setGroupMemberNameCard',
      setGroupMemberMuteTime: 'setGroupMemberMuteTime',
      setGroupMemberRole: 'setGroupMemberRole',
      setGroupMemberCustomField: 'setGroupMemberCustomField',
      getMyProfile: 'getMyProfile',
      getUserProfile: 'getUserProfile',
      updateMyProfile: 'updateMyProfile',
      getBlacklist: 'getBlacklist',
      addToBlacklist: 'addToBlacklist',
      removeFromBlacklist: 'removeFromBlacklist',
      getFriendList: 'getFriendList'
    },
    gp = '1.7.3',
    dp = '537048168',
    mp = '10',
    _p = 'protobuf',
    yp = 'json',
    vp = {
      HOST: {
        TYPE: 3,
        ACCESS_LAYER_TYPES: { SANDBOX: 1, TEST: 2, PRODUCTION: 3 },
        CURRENT: {
          COMMON: 'https://webim.tim.qq.com',
          PIC: 'https://pic.tim.qq.com',
          COS: 'https://yun.tim.qq.com'
        },
        PRODUCTION: {
          COMMON: 'https://webim.tim.qq.com',
          PIC: 'https://pic.tim.qq.com',
          COS: 'https://yun.tim.qq.com'
        },
        SANDBOX: {
          COMMON: 'https://events.tim.qq.com',
          PIC: 'https://pic.tim.qq.com',
          COS: 'https://yun.tim.qq.com'
        },
        TEST: {
          COMMON: 'https://test.tim.qq.com',
          PIC: 'https://pic.tim.qq.com',
          COS: 'https://yun.tim.qq.com'
        },
        setCurrent: function() {
          var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 3
          switch (e) {
            case this.ACCESS_LAYER_TYPES.SANDBOX:
              ;(this.CURRENT = this.SANDBOX), (this.TYPE = this.ACCESS_LAYER_TYPES.SANDBOX)
              break
            case this.ACCESS_LAYER_TYPES.TEST:
              ;(this.CURRENT = this.TEST), (this.TYPE = this.ACCESS_LAYER_TYPES.TEST)
              break
            default:
              ;(this.CURRENT = this.PRODUCTION), (this.TYPE = this.ACCESS_LAYER_TYPES.PRODUCTION)
          }
        }
      },
      NAME: {
        OPEN_IM: 'openim',
        GROUP: 'group_open_http_svc',
        FRIEND: 'sns',
        PROFILE: 'profile',
        RECENT_CONTACT: 'recentcontact',
        PIC: 'openpic',
        BIG_GROUP_NO_AUTH: 'group_open_http_noauth_svc',
        BIG_GROUP_LONG_POLLING_NO_AUTH: 'group_open_long_polling_http_noauth_svc',
        IM_OPEN_STAT: 'imopenstat',
        WEB_IM: 'webim',
        IM_COS_SIGN: 'im_cos_sign_svr'
      },
      CMD: {
        ACCESS_LAYER: 'accesslayer',
        LOGIN: 'login',
        LOGOUT_LONG_POLL: 'longpollinglogout',
        LOGOUT_ALL: 'logout',
        PORTRAIT_GET: 'portrait_get_all',
        PORTRAIT_SET: 'portrait_set',
        GET_LONG_POLL_ID: 'getlongpollingid',
        LONG_POLL: 'longpolling',
        AVCHATROOM_LONG_POLL: 'get_msg',
        FRIEND_ADD: 'friend_add',
        FRIEND_GET_ALL: 'friend_get_all',
        FRIEND_DELETE: 'friend_delete',
        RESPONSE_PENDENCY: 'friend_response',
        GET_PENDENCY: 'pendency_get',
        DELETE_PENDENCY: 'pendency_delete',
        GET_GROUP_PENDENCY: 'get_pendency',
        GET_BLACKLIST: 'black_list_get',
        ADD_BLACKLIST: 'black_list_add',
        DELETE_BLACKLIST: 'black_list_delete',
        CREATE_GROUP: 'create_group',
        GET_JOINED_GROUPS: 'get_joined_group_list',
        SEND_MESSAGE: 'sendmsg',
        REVOKE_C2C_MESSAGE: 'msgwithdraw',
        SEND_GROUP_MESSAGE: 'send_group_msg',
        REVOKE_GROUP_MESSAGE: 'group_msg_recall',
        GET_GROUP_INFO: 'get_group_info',
        GET_GROUP_MEMBER_INFO: 'get_specified_group_member_info',
        GET_GROUP_MEMBER_LIST: 'get_group_member_info',
        QUIT_GROUP: 'quit_group',
        CHANGE_GROUP_OWNER: 'change_group_owner',
        DESTROY_GROUP: 'destroy_group',
        ADD_GROUP_MEMBER: 'add_group_member',
        DELETE_GROUP_MEMBER: 'delete_group_member',
        SEARCH_GROUP_BY_ID: 'get_group_public_info',
        APPLY_JOIN_GROUP: 'apply_join_group',
        HANDLE_APPLY_JOIN_GROUP: 'handle_apply_join_group',
        MODIFY_GROUP_INFO: 'modify_group_base_info',
        MODIFY_GROUP_MEMBER_INFO: 'modify_group_member_info',
        DELETE_GROUP_SYSTEM_MESSAGE: 'deletemsg',
        GET_CONVERSATION_LIST: 'get',
        PAGING_GET_CONVERSATION_LIST: 'page_get',
        DELETE_CONVERSATION: 'delete',
        GET_MESSAGES: 'getmsg',
        GET_C2C_ROAM_MESSAGES: 'getroammsg',
        GET_GROUP_ROAM_MESSAGES: 'group_msg_get',
        SET_C2C_MESSAGE_READ: 'msgreaded',
        SET_GROUP_MESSAGE_READ: 'msg_read_report',
        FILE_READ_AND_WRITE_AUTHKEY: 'authkey',
        FILE_UPLOAD: 'pic_up',
        COS_SIGN: 'cos',
        TIM_WEB_REPORT: 'tim_web_report',
        BIG_DATA_HALLWAY_AUTH_KEY: 'authkey'
      },
      CHANNEL: { SOCKET: 1, XHR: 2, AUTO: 0 },
      NAME_VERSION: {
        openim: 'v4',
        group_open_http_svc: 'v4',
        sns: 'v4',
        profile: 'v4',
        recentcontact: 'v4',
        openpic: 'v4',
        group_open_http_noauth_svc: 'v1',
        group_open_long_polling_http_noauth_svc: 'v1',
        imopenstat: 'v4',
        im_cos_sign_svr: 'v4',
        webim: 'v4'
      }
    }
  vp.HOST.setCurrent(vp.HOST.ACCESS_LAYER_TYPES.PRODUCTION)
  var Ep = {
      request: {
        toAccount: 'To_Account',
        fromAccount: 'From_Account',
        to: 'To_Account',
        from: 'From_Account',
        groupID: 'GroupId',
        avatar: 'FaceUrl'
      },
      response: {
        GroupId: 'groupID',
        Member_Account: 'userID',
        MsgList: 'messageList',
        SyncFlag: 'syncFlag',
        To_Account: 'to',
        From_Account: 'from',
        MsgSeq: 'sequence',
        MsgRandom: 'random',
        MsgTimeStamp: 'time',
        MsgContent: 'content',
        MsgBody: 'elements',
        GroupWithdrawInfoArray: 'revokedInfos',
        WithdrawC2cMsgNotify: 'c2cMessageRevokedNotify',
        C2cWithdrawInfoArray: 'revokedInfos',
        MsgRand: 'random',
        MsgType: 'type',
        MsgShow: 'messageShow',
        NextMsgSeq: 'nextMessageSeq',
        FaceUrl: 'avatar',
        ProfileDataMod: 'profileModify',
        Profile_Account: 'userID',
        ValueBytes: 'value',
        ValueNum: 'value',
        NoticeSeq: 'noticeSequence',
        NotifySeq: 'notifySequence',
        MsgFrom_AccountExtraInfo: 'messageFromAccountExtraInformation',
        Operator_Account: 'operatorID',
        OpType: 'operationType',
        ReportType: 'operationType',
        UserId: 'userID',
        User_Account: 'userID',
        List_Account: 'userIDList',
        MsgOperatorMemberExtraInfo: 'operatorInfo',
        MsgMemberExtraInfo: 'memberInfoList',
        ImageUrl: 'avatar',
        NickName: 'nick',
        MsgGroupNewInfo: 'newGroupProfile',
        Owner_Account: 'ownerID',
        GroupName: 'name',
        GroupFaceUrl: 'avatar',
        GroupIntroduction: 'introduction',
        GroupNotification: 'notification',
        GroupApplyJoinOption: 'joinOption',
        MsgKey: 'messageKey',
        GroupInfo: 'groupProfile',
        ShutupTime: 'muteTime',
        Desc: 'description',
        Ext: 'extension'
      },
      ignoreKeyWord: ['C2C', 'ID', 'USP']
    },
    Sp = {
      CONTEXT_UPDATED: '_contextWasUpdated',
      CONTEXT_RESET: '_contextWasReset',
      CONTEXT_A2KEY_AND_TINYID_UPDATED: '_a2KeyAndTinyIDUpdated',
      RUNNING_STATE_CHANGE: '_runningStateChange',
      SYNC_MESSAGE_C2C_START: '_noticeSynchronizationStart',
      SYNC_MESSAGE_C2C_PROCESSING: '_noticeIsSynchronizing',
      SYNC_MESSAGE_C2C_FINISHED: '_noticeIsSynchronized',
      SYNC_MESSAGE_GROUP_SYSTEM_NOTICE_FINISHED: '_groupSystemNoticeSyncFinished',
      MESSAGE_SENT: '_messageSent',
      MESSAGE_C2C_SEND_SUCCESS: '_sendC2CMessageSuccess',
      MESSAGE_C2C_SEND_FAIL: '_sendC2CMessageFail',
      MESSAGE_SYNC_PROCESSING: '_syncMessageProcessing',
      MESSAGE_SYNC_FINISHED: '_syncMessageFinished',
      MESSAGE_C2C_INSTANT_RECEIVED: '_receiveInstantMessage',
      MESSAGE_C2C_RECEIVE_ROAMING_SUCCESS: '_receiveC2CRoamingMessageSuccess',
      MESSAGE_C2C_RECEIVE_ROAMING_FAIL: '_receiveC2CRoamingMessageFail',
      MESSAGE_GROUP_SEND_SUCCESS: '_sendGroupMessageSuccess',
      MESSAGE_GROUP_SEND_FAIL: '_sendGroupMessageFail',
      MESSAGE_GROUP_RECEIVE_ROAMING_SUCCESS: '_receiveGroupRoamingMessageSuccess',
      MESSAGE_GROUP_RECEIVE_ROAMING_FAIL: '_receiveGroupRoamingMessageFail',
      MESSAGE_GROUP_INSTANT_RECEIVED: '_receiveGroupInstantMessage',
      MESSAGE_GROUP_SYSTEM_NOTICE_RECEIVED: '_receveGroupSystemNotice',
      MESSAGE_REVOKED: '_messageRevoked',
      NOTICE_LONGPOLL_GETID_SUCCESS: '_getLongPollIDSuccess',
      NOTICE_LONGPOLL_GETID_FAIL: '_getLongPollIDFail',
      NOTICE_LONGPOLL_START: '_longPollStart',
      NOTICE_LONGPOLL_IN_POLLING: '_longPollInPolling',
      NOTICE_LONGPOLL_REQUEST_ARRIVED: '_longPollInArrived',
      NOTICE_LONGPOLL_REQUEST_NOT_ARRIVED: '_longPollNotArrived',
      NOTICE_LONGPOLL_REQUEST_ERROR: '_longPollError',
      NOTICE_LONGPOLL_JITTER: '_longPollJitter',
      NOTICE_LONGPOLL_SOON_RECONNECT: '_longPollSoonReconnect',
      NOTICE_LONGPOLL_LONG_RECONNECT: '_longPollLongReconnect',
      NOTICE_LONGPOLL_DISCONNECT: '_longpollChannelDisconnect',
      NOTICE_LONGPOLL_STOPPED: '_longPollStopped',
      NOTICE_LONGPOLL_KICKED_OUT: '_longPollKickedOut',
      NOTICE_LONGPOLL_MUTIPLE_DEVICE_KICKED_OUT: '_longPollMitipuleDeviceKickedOut',
      NOTICE_LONGPOLL_NEW_C2C_NOTICE: '_longPollGetNewC2CNotice',
      NOTICE_LONGPOLL_NEW_C2C_MESSAGES: '_longPollGetNewC2CMessages',
      NOTICE_LONGPOLL_NEW_GROUP_MESSAGES: '_longPollGetNewGroupMessages',
      NOTICE_LONGPOLL_NEW_GROUP_TIPS: '_longPollGetNewGroupTips',
      NOTICE_LONGPOLL_NEW_GROUP_NOTICE: '_longPollGetNewGroupNotice',
      NOTICE_LONGPOLL_NEW_FRIEND_MESSAGES: '_longPollGetNewFriendMessages',
      NOTICE_LONGPOLL_SEQUENCE_UPDATE: '_longPollNoticeSequenceUpdate',
      NOTICE_LONGPOLL_PROFILE_MODIFIED: '_longPollProfileModified',
      NOTICE_LONGPOLL_RECEIVE_SYSTEM_ORDERS: '_longPollNoticeReceiveSystemOrders',
      NOTICE_LONGPOLL_RESTART: '_longpollRestart',
      NOTICE_LONGPOLL_GROUP_MESSAGE_REVOKED: ' _longpollGroupMessageRevoked',
      NOTICE_LONGPOLL_C2C_MESSAGE_REVOKED: '_longpollC2CMessageRevoked',
      APPLY_ADD_FRIEND_SUCCESS: '_addFriendApplySendSucess',
      APPLY_ADD_FRIEND_FAIL: '_addFriendApplySendFail',
      APPLY_GET_PENDENCY_SUCCESS: '_applyGetPendenciesSucess',
      APPLY_GET_PENDENCY_FAIL: '_applyGetPendenciesFail',
      APPLY_DELETE_SUCCESS: '_applyDeletedSucess',
      APPLY_DELETE_FAIL: '_applyDeletedFail',
      GROUP_CREATE_SUCCESS: '_createGroupSuccess',
      GROUP_CREATE_FAIL: '_createGroupFail',
      GROUP_LIST_UPDATED: '_onGroupListUpdated',
      SIGN_LOGIN_CHANGE: '_loginStatusChange',
      SIGN_LOGIN: '_login',
      SIGN_LOGIN_SUCCESS: '_loginSuccess',
      SIGN_LOGIN_FAIL: '_loginFail',
      SIGN_LOGININFO_UPDATED: '_signLoginInfoUpdated',
      SIGN_LOGOUT_EXECUTING: '_signLogoutExcuting',
      SIGN_LOGOUT_SUCCESS: '_logoutSuccess',
      SIGN_GET_ACCESS_LAYER_CHANGE: '_getAccessLayerStatusChange',
      SIGN_GET_ACCESS_LAYER_SUCCESS: '_getAccessLayerSuccess',
      SIGN_GET_ACCESS_LAYER_FAIL: '_getAccessLayerFail',
      SIGN_A2KEY_EXPIRED: '_a2keyExpired',
      ERROR_DETECTED: '_errorHasBeenDetected',
      CONVERSATION_LIST_UPDATED: '_onConversationListUpdated',
      CONVERSATION_LIST_PROFILE_UPDATED: '_onConversationListProfileUpdated',
      CONVERSATION_DELETED: '_conversationDeleted',
      PROFILE_UPDATED: 'onProfileUpdated',
      FRIEND_GET_SUCCESS: '_getFriendsSuccess',
      FRIEND_GET_FAIL: '_getFriendsFail',
      FRIEND_DELETE_SUCCESS: '_deleteFriendSuccess',
      FRIEND_DELETE_FAIL: '_deleteFriendFail',
      BLACKLIST_ADD_SUCCESS: '_addBlacklistSuccess',
      BLACKLIST_ADD_FAIL: '_addBlacklistFail',
      BLACKLIST_GET_SUCCESS: '_getBlacklistSuccess',
      BLACKLIST_GET_FAIL: '_getBlacklistFail',
      AVCHATROOM_OPTIONS_UPDATED: '_AVChatRoomOptionsUpdated',
      AVCHATROOM_JOIN_SUCCESS: 'joinAVChatRoomSuccess',
      SDK_MEMORY_STATUS_UPDATE: '_sdkMemoryStatusUpdate',
      SDK_READY: '_sdkStateReady'
    },
    Ip = He.filter,
    Cp = fn('filter'),
    Tp =
      Cp &&
      !o(function() {
        ;[].filter.call({ length: -1, 0: 1 }, function(e) {
          throw e
        })
      })
  Ne(
    { target: 'Array', proto: !0, forced: !Cp || !Tp },
    {
      filter: function(e) {
        return Ip(this, e, arguments.length > 1 ? arguments[1] : void 0)
      }
    }
  ),
    Ne({ target: 'Object', stat: !0, forced: Object.assign !== Tu }, { assign: Tu })
  var Mp = So.trim
  function Op(e, t) {
    if ('string' != typeof e && !Array.isArray(e))
      throw new TypeError('Expected the input to be `string | string[]`')
    t = Object.assign({ pascalCase: !1 }, t)
    var n
    return 0 ===
      (e = Array.isArray(e)
        ? e
            .map(function(e) {
              return e.trim()
            })
            .filter(function(e) {
              return e.length
            })
            .join('-')
        : e.trim()).length
      ? ''
      : 1 === e.length
      ? t.pascalCase
        ? e.toUpperCase()
        : e.toLowerCase()
      : (e !== e.toLowerCase() && (e = Ap(e)),
        (e = e
          .replace(/^[_.\- ]+/, '')
          .toLowerCase()
          .replace(/[_.\- ]+(\w|$)/g, function(e, t) {
            return t.toUpperCase()
          })
          .replace(/\d+(\w|$)/g, function(e) {
            return e.toUpperCase()
          })),
        (n = e),
        t.pascalCase ? n.charAt(0).toUpperCase() + n.slice(1) : n)
  }
  Ne(
    {
      target: 'String',
      proto: !0,
      forced: (function(e) {
        return o(function() {
          return !!mo[e]() || '​᠎' != '​᠎'[e]() || mo[e].name !== e
        })
      })('trim')
    },
    {
      trim: function() {
        return Mp(this)
      }
    }
  )
  var Ap = function(e) {
    for (var t = !1, n = !1, r = !1, o = 0; o < e.length; o++) {
      var i = e[o]
      t && /[a-zA-Z]/.test(i) && i.toUpperCase() === i
        ? ((e = e.slice(0, o) + '-' + e.slice(o)), (t = !1), (r = n), (n = !0), o++)
        : n && r && /[a-zA-Z]/.test(i) && i.toLowerCase() === i
        ? ((e = e.slice(0, o - 1) + '-' + e.slice(o - 1)), (r = n), (n = !1), (t = !0))
        : ((t = i.toLowerCase() === i && i.toUpperCase() !== i),
          (r = n),
          (n = i.toUpperCase() === i && i.toLowerCase() !== i))
    }
    return e
  }
  function Dp(e, t, n) {
    var r = [],
      o = 0,
      i = (function e(t, n) {
        if (++o > 10) return o--, t
        if (Ks(t)) {
          var i = t.map(function(t) {
            return qs(t) ? e(t, n) : t
          })
          return o--, i
        }
        if (qs(t)) {
          var a =
            ((s = t),
            (u = function(e, t) {
              if (!Ws(t)) return !1
              if ((a = t) !== Op(a)) {
                for (var o = !0, i = 0; i < Ep.ignoreKeyWord.length; i++)
                  if (t.includes(Ep.ignoreKeyWord[i])) {
                    o = !1
                    break
                  }
                o && r.push(t)
              }
              var a
              return Bs(n[t])
                ? (function(e) {
                    return e[0].toUpperCase() + Op(e).slice(1)
                  })(t)
                : n[t]
            }),
            (c = Object.create(null)),
            Object.keys(s).forEach(function(e) {
              var t = u(s[e], e)
              t && (c[t] = s[e])
            }),
            c)
          return (
            (a = hu(a, function(t, r) {
              return Ks(t) || qs(t) ? e(t, n) : t
            })),
            o--,
            a
          )
        }
        var s, u, c
      })(e, (t = An({}, Ep.request, {}, t)))
    return (
      r.length > 0 &&
        n.innerEmitter.emit(Sp.ERROR_DETECTED, {
          code: rp.CONVERTOR_IRREGULAR_PARAMS,
          message: op.CONVERTOR_IRREGULAR_PARAMS
        }),
      i
    )
  }
  function Np(e, t) {
    if (((t = An({}, Ep.response, {}, t)), Ks(e)))
      return e.map(function(e) {
        return qs(e) ? Np(e, t) : e
      })
    if (qs(e)) {
      var n =
        ((r = e),
        (o = function(e, n) {
          return Bs(t[n]) ? Op(n) : t[n]
        }),
        (i = {}),
        Object.keys(r).forEach(function(e) {
          i[o(r[e], e)] = r[e]
        }),
        i)
      return (n = hu(n, function(e) {
        return Ks(e) || qs(e) ? Np(e, t) : e
      }))
    }
    var r, o, i
  }
  var Rp = (function() {
      function e(t, n) {
        var r = this
        if ((In(this, e), void 0 === n))
          throw new np({ code: rp.NO_SDK_INSTANCE, message: op.NO_SDK_INSTANCE })
        ;(this.tim = n),
          (this.method = t.method || 'POST'),
          this._initializeServerMap(),
          this._initializeURL(t),
          this._initializeRequestData(t),
          (this.callback = function(e) {
            return Np((e = t.decode(e)), r._getResponseMap(t))
          })
      }
      return (
        Tn(e, [
          {
            key: '_initializeServerMap',
            value: function() {
              this._serverMap = Object.create(null)
              var e = ''
              for (var t in vp.NAME)
                if (Object.prototype.hasOwnProperty.call(vp.NAME, t))
                  switch ((e = vp.NAME[t])) {
                    case vp.NAME.PIC:
                      this._serverMap[e] = vp.HOST.CURRENT.PIC
                      break
                    case vp.NAME.IM_COS_SIGN:
                      this._serverMap[e] = vp.HOST.CURRENT.COS
                      break
                    default:
                      this._serverMap[e] = vp.HOST.CURRENT.COMMON
                  }
            }
          },
          {
            key: '_getHost',
            value: function(e) {
              if (void 0 !== this._serverMap[e]) return this._serverMap[e]
              throw new np({
                code: rp.NETWORK_UNDEFINED_SERVER_NAME,
                message: op.NETWORK_UNDEFINED_SERVER_NAME
              })
            }
          },
          {
            key: '_initializeURL',
            value: function(e) {
              var t = e.serverName,
                n = e.cmd,
                r = this._getHost(t),
                o = ''
                  .concat(r, '/')
                  .concat(vp.NAME_VERSION[t], '/')
                  .concat(t, '/')
                  .concat(n)
              ;(o += '?'.concat(this._getQueryString(e.queryString))), (this.url = o)
            }
          },
          {
            key: 'getUrl',
            value: function() {
              return this.url.replace(
                /&reqtime=(\d+)/,
                '&reqtime='.concat(Math.ceil(+new Date() / 1e3))
              )
            }
          },
          {
            key: '_initializeRequestData',
            value: function(e) {
              var t,
                n = e.requestData
              ;(t = this._requestDataCleaner(n)), (this.requestData = e.encode(t))
            }
          },
          {
            key: '_requestDataCleaner',
            value: function(e) {
              var t = Array.isArray(e) ? [] : Object.create(null)
              for (var n in e)
                Object.prototype.hasOwnProperty.call(e, n) &&
                  Ws(n) &&
                  null !== e[n] &&
                  ('object' !== Sn(e[n])
                    ? (t[n] = e[n])
                    : (t[n] = this._requestDataCleaner.bind(this)(e[n])))
              return t
            }
          },
          {
            key: '_getQueryString',
            value: function(e) {
              var t = []
              for (var n in e)
                Object.prototype.hasOwnProperty.call(e, n) &&
                  ('function' != typeof e[n]
                    ? t.push(''.concat(n, '=').concat(e[n]))
                    : t.push(''.concat(n, '=').concat(e[n]())))
              return t.join('&')
            }
          },
          {
            key: '_getResponseMap',
            value: function(e) {
              if (e.keyMaps && e.keyMaps.response && Object.keys(e.keyMaps.response).length > 0)
                return e.keyMaps.response
            }
          }
        ]),
        e
      )
    })(),
    Lp = [].slice,
    Pp = /MSIE .\./.test(sn),
    kp = function(e) {
      return function(t, n) {
        var r = arguments.length > 2,
          o = r ? Lp.call(arguments, 2) : void 0
        return e(
          r
            ? function() {
                ;('function' == typeof t ? t : Function(t)).apply(this, o)
              }
            : t,
          n
        )
      }
    }
  function Gp(e) {
    this.mixin(e)
  }
  Ne(
    { global: !0, bind: !0, forced: Pp },
    { setTimeout: kp(r.setTimeout), setInterval: kp(r.setInterval) }
  ),
    (Gp.mixin = function(e) {
      var t = e.prototype || e
      ;(t._isReady = !1),
        (t.ready = function(e) {
          var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
          if (e)
            return this._isReady
              ? void (t ? e.call(this) : setTimeout(e, 1))
              : ((this._readyQueue = this._readyQueue || []), void this._readyQueue.push(e))
        }),
        (t.triggerReady = function() {
          var e = this
          ;(this._isReady = !0),
            setTimeout(function() {
              var t = e._readyQueue
              ;(e._readyQueue = []),
                t &&
                  t.length > 0 &&
                  t.forEach(function(e) {
                    e.call(this)
                  }, e)
            }, 1)
        }),
        (t.resetReady = function() {
          ;(this._isReady = !1), (this._readyQueue = [])
        }),
        (t.isReady = function() {
          return this._isReady
        })
    })
  var wp = (function() {
      function e(t) {
        if ((In(this, e), !1 == !!t))
          throw new np({ code: rp.NO_SDK_INSTANCE, message: op.NO_SDK_INSTANCE })
        Gp.mixin(this),
          (this.tim = t),
          (this.innerEmitter = t.innerEmitter),
          (this.connectionController = t.connectionController),
          (this.packageConfig = t.packageConfig),
          this.packageConfig.update(t)
      }
      return (
        Tn(e, [
          {
            key: 'isLoggedIn',
            value: function() {
              return this.tim.context.login === yu.LOGIN.IS_LOGIN
            }
          },
          {
            key: 'createPackage',
            value: function(e) {
              var t = this.packageConfig.get(e)
              return !!t && new Rp(t, this.tim)
            }
          },
          {
            key: 'reset',
            value: function() {
              Gs.warn(['method: IMController.reset() method must be implemented'].join())
            }
          },
          {
            key: 'probeNetwork',
            value: function() {
              return this.tim.netMonitor.probe()
            }
          },
          {
            key: 'getNetworkType',
            value: function() {
              return this.tim.netMonitor.getNetworkType()
            }
          },
          {
            key: 'destroy',
            value: function() {
              Gs.warn('destory')
            }
          },
          {
            key: 'getPlatform',
            value: function() {
              var e = 'web'
              return ps ? (e = 'wechat') : es && (e = 'wxmp'), e
            }
          }
        ]),
        e
      )
    })(),
    bp = (function() {
      function e(t, n) {
        In(this, e),
          (this.data = t),
          (this.tim = n),
          (this.defaultData = {}),
          Object.assign(this.defaultData, t),
          this.initGetterAndSetter()
      }
      return (
        Tn(e, [
          {
            key: 'initGetterAndSetter',
            value: function() {
              var e = this,
                t = this.tim,
                n = function(n, r) {
                  Object.defineProperty(e, n, {
                    enumerable: !0,
                    configurable: !0,
                    get: function() {
                      return e.data[n]
                    },
                    set: function(r) {
                      ;(e.data[n] = r), e.onChange.bind(e)(t.context, n, r)
                    }
                  })
                }
              for (var r in e.data)
                Object.prototype.hasOwnProperty.call(e.data, r) && n(r, e.data[r])
            }
          },
          {
            key: 'onChange',
            value: function(e, t, n) {
              this.tim.innerEmitter.emit(Sp.CONTEXT_UPDATED, {
                data: { context: e, key: t, value: n }
              })
            }
          },
          {
            key: 'reset',
            value: function() {
              for (var e in this.data)
                Object.prototype.hasOwnProperty.call(this.data, e) &&
                  (this.data[e] = this.defaultData.hasOwnProperty(e) ? this.defaultData[e] : null)
              this.tim.innerEmitter.emit(Sp.CONTEXT_RESET, { data: this.tim.context })
            }
          }
        ]),
        e
      )
    })(),
    Up = (function(e) {
      function t(e) {
        var n
        return In(this, t), (n = Gn(this, Nn(t).call(this, e)))._initContext(), n._initListener(), n
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'reset',
            value: function() {
              this.tim.context.reset()
            }
          },
          {
            key: '_initListener',
            value: function() {
              this.tim.innerEmitter.on(Sp.SIGN_LOGIN_SUCCESS, this._updateA2KeyAndTinyID, this)
            }
          },
          {
            key: '_updateA2KeyAndTinyID',
            value: function(e) {
              var t = e.data,
                n = t.a2Key,
                r = t.tinyID
              this.set('a2Key', n),
                this.set('tinyID', r),
                this.tim.innerEmitter.emit(Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED, {
                  data: { context: this.tim.context }
                }),
                this.triggerReady()
            }
          },
          {
            key: 'get',
            value: function(e) {
              return this.tim.context[e]
            }
          },
          {
            key: 'set',
            value: function(e, t) {
              this.tim.context[e] = t
            }
          },
          {
            key: '_initContext',
            value: function() {
              var e = this.tim.loginInfo
              ;(this.tim.context = new bp(
                {
                  login: yu.LOGIN.IS_NOT_LOGIN,
                  SDKAppID: e.SDKAppID,
                  appIDAt3rd: null,
                  accountType: e.accountType,
                  identifier: e.identifier,
                  tinyID: null,
                  identifierNick: e.identifierNick,
                  userSig: e.userSig,
                  a2Key: null,
                  contentType: 'json',
                  apn: 1
                },
                this.tim
              )),
                this.tim.innerEmitter.on(Sp.CONTEXT_UPDATED, this._onContextMemberChange.bind(this))
            }
          },
          {
            key: '_onContextMemberChange',
            value: function(e) {
              var t = e.data,
                n = t.key,
                r = t.value
              switch (n) {
                case 'tinyID':
                  r.length <= 0
                    ? (this.tim.context.login = yu.LOGIN.IS_NOT_LOGIN)
                    : (this.tim.context.login =
                        null !== this.tim.context.a2Key ? yu.LOGIN.IS_LOGIN : yu.LOGIN.IS_NOT_LOGIN)
                  break
                case 'a2Key':
                  r.length <= 0
                    ? (this.tim.context.login = yu.LOGIN.IS_NOT_LOGIN)
                    : (this.tim.context.login =
                        null !== this.tim.context.tinyID
                          ? yu.LOGIN.IS_LOGIN
                          : yu.LOGIN.IS_NOT_LOGIN)
              }
            }
          }
        ]),
        t
      )
    })(wp),
    xp = function e(t) {
      In(this, e), (this.code = 0), (this.data = t || {})
    },
    Fp = null,
    qp = function(e) {
      Fp = e
    },
    Vp = function(e) {
      return e instanceof xp
        ? (Gs.warn(
            'IMPromise.resolve 此函数会自动用options创建IMResponse实例，调用侧不需创建，建议修改！'
          ),
          Promise.resolve(e))
        : Promise.resolve(new xp(e))
    },
    Kp = function(e) {
      var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]
      if (e instanceof np) return t && null !== Fp && Fp.emit(on.ERROR, e), Promise.reject(e)
      if (e instanceof Error) {
        var n = new np({ code: rp.UNCAUGHT_ERROR, message: e.message })
        return t && null !== Fp && Fp.emit(on.ERROR, n), Promise.reject(n)
      }
      if (Bs(e) || Bs(e.code) || Bs(e.message))
        Gs.error('IMPromise.reject 必须指定code(错误码)和message(错误信息)!!!')
      else {
        if (xs(e.code) && Fs(e.message)) {
          var r = new np(e)
          return t && null !== Fp && Fp.emit(on.ERROR, r), Promise.reject(r)
        }
        Gs.error('IMPromise.reject code(错误码)必须为数字，message(错误信息)必须为字符串!!!')
      }
    },
    Bp = {
      SDK_READY: 'sdkReady',
      LOGIN: 'login',
      LONG_POLLING: 'longpolling',
      LONG_POLLING_AV: 'longpollingAV',
      SEND_MESSAGE: 'sendMessage',
      INIT_CONVERSATION_LIST: 'initConversationList',
      INIT_GROUP_LIST: 'initGroupList',
      UPLOAD: 'upload'
    },
    Hp = (function() {
      function e() {
        In(this, e),
          (this.SDKAppID = ''),
          (this.version = ''),
          (this.tinyID = ''),
          (this.userID = ''),
          (this.platform = ''),
          (this.method = ''),
          (this.time = ''),
          (this.startts = 0),
          (this.endts = 0),
          (this.timespan = 0),
          (this.codeint = 0),
          (this.message = ''),
          (this.text = ''),
          (this.msgType = ''),
          (this.networkType = ''),
          (this.platform = ''),
          (this._sentFlag = !1)
      }
      return (
        Tn(
          e,
          [
            {
              key: 'setCommonInfo',
              value: function(e, t, n, r, o) {
                ;(this.SDKAppID = ''.concat(e)),
                  (this.version = ''.concat(t)),
                  (this.tinyID = n),
                  (this.userID = r),
                  (this.platform = o),
                  (this.time = Zs()),
                  this.startts &&
                    this.endts &&
                    !this.timespan &&
                    (this.timespan = Math.abs(this.endts - this.startts))
              }
            },
            {
              key: 'setMethod',
              value: function(e) {
                return (this.method = e), this
              }
            },
            {
              key: 'setStart',
              value: function() {
                this.startts = Date.now()
              }
            },
            {
              key: 'setEnd',
              value: function() {
                var e = this,
                  t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]
                this._sentFlag ||
                  ((this.endts = Date.now()),
                  t
                    ? ((this._sentFlag = !0), this._eventStatController.pushIn(this))
                    : setTimeout(function() {
                        ;(e._sentFlag = !0), e._eventStatController.pushIn(e)
                      }, 0))
              }
            },
            {
              key: 'setError',
              value: function(e, t, n) {
                return e instanceof Error
                  ? this._sentFlag
                    ? this
                    : (this.setNetworkType(n),
                      t
                        ? (e.code && this.setCode(e.code), e.message && this.setMessage(e.message))
                        : (this.setCode(rp.NO_NETWORK), this.setMessage(op.NO_NETWORK)),
                      this)
                  : (Gs.warn('SSOLogData.setError value not instanceof Error, please check!'), this)
              }
            },
            {
              key: 'setCode',
              value: function(e) {
                return Bs(e) || this._sentFlag
                  ? this
                  : (xs(e)
                      ? (this.codeint = e)
                      : Gs.warn('SSOLogData.setCode value not a number, please check!'),
                    this)
              }
            },
            {
              key: 'setMessage',
              value: function(e) {
                return Bs(e) || this._sentFlag ? this : Fs(e) ? ((this.message = e), this) : this
              }
            },
            {
              key: 'setText',
              value: function(e) {
                return xs(e) ? (this.text = e.toString()) : Fs(e) && (this.text = e), this
              }
            },
            {
              key: 'setMessageType',
              value: function(e) {
                return (this.msgType = e), this
              }
            },
            {
              key: 'setNetworkType',
              value: function(e) {
                return (this.networkType = e), this
              }
            }
          ],
          [
            {
              key: 'bindController',
              value: function(t) {
                e.prototype._eventStatController = t
              }
            }
          ]
        ),
        e
      )
    })(),
    jp = {
      SDK_CONSTRUCT: 'sdkConstruct',
      SDK_READY: 'sdkReady',
      ACCESS_LAYER: 'accessLayer',
      LOGIN: 'login',
      CREATE_TEXT_MESSAGE: 'createTextMessage',
      CREATE_IMAGE_MESSAGE: 'createImageMessage',
      CREATE_AUDIO_MESSAGE: 'createAudioMessage',
      CREATE_VIDEO_MESSAGE: 'createVideoMessage',
      CREATE_FILE_MESSAGE: 'createFileMessage',
      CREATE_CUSTOM_MESSAGE: 'createCustomMessage',
      UPLOAD: 'upload',
      SEND_MESSAGE: 'sendMessage',
      GET_MESSAGE_LIST: 'getMessageList',
      REVOKE_MESSAGE: 'revokeMessage',
      GET_CONVERSATION_LIST: 'getConversationList',
      GET_CONVERSATION_LIST_IN_STORAGE: 'getConversationListInStorage',
      SYNC_CONVERSATION_LIST: 'syncConversationList',
      CREATE_GROUP: 'createGroup',
      APPLY_JOIN_GROUP: 'applyJoinGroup',
      QUIT_GROUP: 'quitGroup',
      CHANGE_GROUP_OWNER: 'changeGroupOwner',
      DISMISS_GROUP: 'dismissGroup',
      UPDATE_GROUP_PROFILE: 'updateGroupProfile',
      GET_GROUP_LIST: 'getGroupList',
      GET_GROUP_LIST_IN_STORAGE: 'getGroupListInStorage',
      SET_GROUPMEMBER_MUTE_TIME: 'setGroupMemberMuteTime',
      SET_GROUPMEMBER_NAME_CARD: 'setGroupMemberNameCard',
      SET_GROUPMEMBER_ROLE: 'setGroupMemberRole',
      SET_GROUPMEMBER_CUSTOM_FIELD: 'setGroupMemberCustomField',
      SYNC_MESSAGE: 'syncMessage',
      GET_LONGPOLL_ID: 'getLongPollID',
      LONG_POLLING_ERROR: 'longPollingError',
      LONG_POLLING_AV_ERROR: 'longPollingAVError',
      GET_USER_PROFILE: 'getUserProfile',
      GET_BLACKLIST: 'getBlacklist',
      MP_HIDE_TO_SHOW: 'mpHideToShow'
    },
    Yp = (function(e) {
      function t(e) {
        var n
        return In(this, t), (n = Gn(this, Nn(t).call(this, e)))._initializeListener(), n
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'login',
            value: function(e) {
              if (this._isLogin()) {
                var t = '您已经登录账号'.concat(
                  e.identifier,
                  '！如需切换账号登录，请先调用 logout 接口登出，再调用 login 接口登录。'
                )
                return Gs.warn(t), Vp(new xp({ actionStatus: 'OK', errorCode: 0, errorInfo: t }))
              }
              Gs.log('SignController.login userID=', e.identifier), Gs.time(Bp.LOGIN)
              var n = this._checkLoginInfo(e)
              return gu(n)
                ? ((this.tim.context.identifier = e.identifier),
                  (this.tim.context.userSig = e.userSig),
                  (this.tim.context.SDKAppID = e.SDKAppID),
                  (this.tim.context.accountType = e.accountType),
                  this.tim.context.identifier && this.tim.context.userSig
                    ? (this.tim.innerEmitter.emit(Sp.SIGN_LOGIN), this._accessLayer())
                    : void 0)
                : Kp(n)
            }
          },
          {
            key: '_isLogin',
            value: function() {
              return !!this.tim.context.a2Key
            }
          },
          {
            key: '_isLoginCurrentUser',
            value: function(e) {
              return this.tim.context.identifier === e
            }
          },
          {
            key: '_initializeListener',
            value: function() {
              this.innerEmitter.on(Sp.NOTICE_LONGPOLL_KICKED_OUT, this._onKickedOut, this),
                this.innerEmitter.on(
                  Sp.NOTICE_LONGPOLL_MUTIPLE_DEVICE_KICKED_OUT,
                  this._onMultipleDeviceKickedOut,
                  this
                ),
                this.innerEmitter.on(Sp.SIGN_A2KEY_EXPIRED, this._onUserSigExpired, this)
            }
          },
          {
            key: '_accessLayer',
            value: function() {
              var e = this,
                t = new Hp()
              t.setMethod(jp.ACCESS_LAYER).setStart(), Gs.log('SignController._accessLayer.')
              var n = this.createPackage({ name: 'accessLayer', action: 'query' })
              return this.tim.connectionController
                .request(n)
                .then(function(n) {
                  return (
                    t
                      .setCode(0)
                      .setNetworkType(e.getNetworkType())
                      .setText(n.data.webImAccessLayer)
                      .setEnd(),
                    Gs.log(
                      'SignController._accessLayer ok. webImAccessLayer=',
                      n.data.webImAccessLayer
                    ),
                    1 === n.data.webImAccessLayer && vp.HOST.setCurrent(n.data.webImAccessLayer),
                    e._login()
                  )
                })
                .catch(function(n) {
                  return (
                    e.probeNetwork().then(function(r, o) {
                      t.setError(n, r, o).setEnd(!0), e.tim.eventStatController.reportAtOnce()
                    }),
                    Gs.error('SignController._accessLayer error:', n),
                    Kp(n)
                  )
                })
            }
          },
          {
            key: '_login',
            value: function() {
              var e = this,
                t = new Hp()
              t.setMethod(jp.LOGIN).setStart()
              var n = this.createPackage({ name: 'login', action: 'query' })
              return this.connectionController
                .request(n)
                .then(function(n) {
                  var r = null
                  if (!n.data.tinyID)
                    throw ((r = new np({ code: rp.NO_TINYID, message: op.NO_TINYID })),
                    t.setError(r, !0, e.getNetworkType()).setEnd(),
                    r)
                  if (!n.data.a2Key)
                    throw ((r = new np({ code: rp.NO_A2KEY, message: op.NO_A2KEY })),
                    t.setError(r, !0, e.getNetworkType()).setEnd(),
                    r)
                  return (
                    t
                      .setCode(0)
                      .setNetworkType(e.getNetworkType())
                      .setText(''.concat(e.tim.loginInfo.identifier))
                      .setEnd(),
                    Gs.log(
                      'SignController.login ok. userID='
                        .concat(e.tim.loginInfo.identifier, ' loginCost=')
                        .concat(Gs.timeEnd(Bp.LOGIN), 'ms')
                    ),
                    e.tim.innerEmitter.emit(Sp.SIGN_LOGIN_SUCCESS, {
                      data: { a2Key: n.data.a2Key, tinyID: n.data.tinyID }
                    }),
                    Vp(n.data)
                  )
                })
                .catch(function(n) {
                  return (
                    e.probeNetwork().then(function(e, r) {
                      t.setError(n, e, r).setEnd(!0)
                    }),
                    Gs.error('SignController.login error:', n),
                    Kp(n)
                  )
                })
            }
          },
          {
            key: 'logout',
            value: function() {
              return (
                Gs.info('SignController.logout'),
                this.tim.innerEmitter.emit(Sp.SIGN_LOGOUT_EXECUTING),
                this._logout(xl)
                  .then(this._emitLogoutSuccess.bind(this))
                  .catch(this._emitLogoutSuccess.bind(this))
              )
            }
          },
          {
            key: '_logout',
            value: function(e) {
              var t = this.tim.notificationController,
                n = e === Ul ? 'logout' : 'longPollLogout',
                r =
                  e === Ul
                    ? { name: n, action: 'query' }
                    : { name: n, action: 'query', param: { longPollID: t.getLongPollID() } },
                o = this.createPackage(r)
              return this.connectionController.request(o).catch(function(e) {
                return Gs.error('SignController._logout error:', e), Kp(e)
              })
            }
          },
          {
            key: '_checkLoginInfo',
            value: function(e) {
              var t = 0,
                n = ''
              return (
                null === e.SDKAppID
                  ? ((t = rp.NO_SDKAPPID), (n = op.NO_SDKAPPID))
                  : null === e.accountType
                  ? ((t = rp.NO_ACCOUNT_TYPE), (n = op.NO_ACCOUNT_TYPE))
                  : null === e.identifier
                  ? ((t = rp.NO_IDENTIFIER), (n = op.NO_IDENTIFIER))
                  : null === e.userSig && ((t = rp.NO_USERSIG), (n = op.NO_USERSIG)),
                gu(t) || gu(n) ? {} : { code: t, message: n }
              )
            }
          },
          {
            key: '_emitLogoutSuccess',
            value: function() {
              return this.tim.innerEmitter.emit(Sp.SIGN_LOGOUT_SUCCESS), Vp({})
            }
          },
          {
            key: '_onKickedOut',
            value: function() {
              var e = this
              Gs.warn(
                'SignController._onKickedOut kicked out. userID='.concat(
                  this.tim.loginInfo.identifier
                )
              ),
                this.tim.logout().then(function() {
                  e.tim.outerEmitter.emit(on.KICKED_OUT, { type: an.KICKED_OUT_MULT_ACCOUNT })
                })
            }
          },
          {
            key: '_onMultipleDeviceKickedOut',
            value: function() {
              var e = this
              Gs.warn(
                'SignController._onMultipleDeviceKickedOut kicked out. userID='.concat(
                  this.tim.loginInfo.identifier
                )
              ),
                this.tim.logout().then(function() {
                  e.tim.outerEmitter.emit(on.KICKED_OUT, { type: an.KICKED_OUT_MULT_DEVICE })
                })
            }
          },
          {
            key: '_onUserSigExpired',
            value: function() {
              Gs.warn('SignController._onUserSigExpired: userSig 签名过期被踢下线'),
                this.tim.outerEmitter.emit(on.KICKED_OUT, { type: an.KICKED_OUT_USERSIG_EXPIRED }),
                this.tim.resetSDK()
            }
          },
          {
            key: 'reset',
            value: function() {
              Gs.info('SignController.reset')
            }
          }
        ]),
        t
      )
    })(wp),
    $p = function(e, t) {
      return function() {
        for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r]
        return e.apply(t, n)
      }
    },
    Wp = Object.prototype.toString
  function zp(e) {
    return '[object Array]' === Wp.call(e)
  }
  function Xp(e) {
    return null !== e && 'object' == typeof e
  }
  function Jp(e) {
    return '[object Function]' === Wp.call(e)
  }
  function Qp(e, t) {
    if (null != e)
      if (('object' != typeof e && (e = [e]), zp(e)))
        for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e)
      else for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.call(null, e[o], o, e)
  }
  var Zp = {
    isArray: zp,
    isArrayBuffer: function(e) {
      return '[object ArrayBuffer]' === Wp.call(e)
    },
    isBuffer: function(e) {
      return (
        null != e &&
        null != e.constructor &&
        'function' == typeof e.constructor.isBuffer &&
        e.constructor.isBuffer(e)
      )
    },
    isFormData: function(e) {
      return 'undefined' != typeof FormData && e instanceof FormData
    },
    isArrayBufferView: function(e) {
      return 'undefined' != typeof ArrayBuffer && ArrayBuffer.isView
        ? ArrayBuffer.isView(e)
        : e && e.buffer && e.buffer instanceof ArrayBuffer
    },
    isString: function(e) {
      return 'string' == typeof e
    },
    isNumber: function(e) {
      return 'number' == typeof e
    },
    isObject: Xp,
    isUndefined: function(e) {
      return void 0 === e
    },
    isDate: function(e) {
      return '[object Date]' === Wp.call(e)
    },
    isFile: function(e) {
      return '[object File]' === Wp.call(e)
    },
    isBlob: function(e) {
      return '[object Blob]' === Wp.call(e)
    },
    isFunction: Jp,
    isStream: function(e) {
      return Xp(e) && Jp(e.pipe)
    },
    isURLSearchParams: function(e) {
      return 'undefined' != typeof URLSearchParams && e instanceof URLSearchParams
    },
    isStandardBrowserEnv: function() {
      return (
        ('undefined' == typeof navigator ||
          ('ReactNative' !== navigator.product &&
            'NativeScript' !== navigator.product &&
            'NS' !== navigator.product)) &&
        'undefined' != typeof window && 'undefined' != typeof document
      )
    },
    forEach: Qp,
    merge: function e() {
      var t = {}
      function n(n, r) {
        'object' == typeof t[r] && 'object' == typeof n ? (t[r] = e(t[r], n)) : (t[r] = n)
      }
      for (var r = 0, o = arguments.length; r < o; r++) Qp(arguments[r], n)
      return t
    },
    deepMerge: function e() {
      var t = {}
      function n(n, r) {
        'object' == typeof t[r] && 'object' == typeof n
          ? (t[r] = e(t[r], n))
          : (t[r] = 'object' == typeof n ? e({}, n) : n)
      }
      for (var r = 0, o = arguments.length; r < o; r++) Qp(arguments[r], n)
      return t
    },
    extend: function(e, t, n) {
      return (
        Qp(t, function(t, r) {
          e[r] = n && 'function' == typeof t ? $p(t, n) : t
        }),
        e
      )
    },
    trim: function(e) {
      return e.replace(/^\s*/, '').replace(/\s*$/, '')
    }
  }
  function eh(e) {
    return encodeURIComponent(e)
      .replace(/%40/gi, '@')
      .replace(/%3A/gi, ':')
      .replace(/%24/g, '$')
      .replace(/%2C/gi, ',')
      .replace(/%20/g, '+')
      .replace(/%5B/gi, '[')
      .replace(/%5D/gi, ']')
  }
  var th = function(e, t, n) {
    if (!t) return e
    var r
    if (n) r = n(t)
    else if (Zp.isURLSearchParams(t)) r = t.toString()
    else {
      var o = []
      Zp.forEach(t, function(e, t) {
        null != e &&
          (Zp.isArray(e) ? (t += '[]') : (e = [e]),
          Zp.forEach(e, function(e) {
            Zp.isDate(e) ? (e = e.toISOString()) : Zp.isObject(e) && (e = JSON.stringify(e)),
              o.push(eh(t) + '=' + eh(e))
          }))
      }),
        (r = o.join('&'))
    }
    if (r) {
      var i = e.indexOf('#')
      ;-1 !== i && (e = e.slice(0, i)), (e += (-1 === e.indexOf('?') ? '?' : '&') + r)
    }
    return e
  }
  function nh() {
    this.handlers = []
  }
  ;(nh.prototype.use = function(e, t) {
    return this.handlers.push({ fulfilled: e, rejected: t }), this.handlers.length - 1
  }),
    (nh.prototype.eject = function(e) {
      this.handlers[e] && (this.handlers[e] = null)
    }),
    (nh.prototype.forEach = function(e) {
      Zp.forEach(this.handlers, function(t) {
        null !== t && e(t)
      })
    })
  var rh = nh,
    oh = function(e, t, n) {
      return (
        Zp.forEach(n, function(n) {
          e = n(e, t)
        }),
        e
      )
    },
    ih = function(e) {
      return !(!e || !e.__CANCEL__)
    }
  function ah() {
    throw new Error('setTimeout has not been defined')
  }
  function sh() {
    throw new Error('clearTimeout has not been defined')
  }
  var uh = ah,
    ch = sh
  function lh(e) {
    if (uh === setTimeout) return setTimeout(e, 0)
    if ((uh === ah || !uh) && setTimeout) return (uh = setTimeout), setTimeout(e, 0)
    try {
      return uh(e, 0)
    } catch (t) {
      try {
        return uh.call(null, e, 0)
      } catch (t) {
        return uh.call(this, e, 0)
      }
    }
  }
  'function' == typeof Ms.setTimeout && (uh = setTimeout),
    'function' == typeof Ms.clearTimeout && (ch = clearTimeout)
  var ph,
    hh = [],
    fh = !1,
    gh = -1
  function dh() {
    fh && ph && ((fh = !1), ph.length ? (hh = ph.concat(hh)) : (gh = -1), hh.length && mh())
  }
  function mh() {
    if (!fh) {
      var e = lh(dh)
      fh = !0
      for (var t = hh.length; t; ) {
        for (ph = hh, hh = []; ++gh < t; ) ph && ph[gh].run()
        ;(gh = -1), (t = hh.length)
      }
      ;(ph = null),
        (fh = !1),
        (function(e) {
          if (ch === clearTimeout) return clearTimeout(e)
          if ((ch === sh || !ch) && clearTimeout) return (ch = clearTimeout), clearTimeout(e)
          try {
            ch(e)
          } catch (t) {
            try {
              return ch.call(null, e)
            } catch (t) {
              return ch.call(this, e)
            }
          }
        })(e)
    }
  }
  function _h(e, t) {
    ;(this.fun = e), (this.array = t)
  }
  _h.prototype.run = function() {
    this.fun.apply(null, this.array)
  }
  function yh() {}
  var vh = yh,
    Eh = yh,
    Sh = yh,
    Ih = yh,
    Ch = yh,
    Th = yh,
    Mh = yh
  var Oh = Ms.performance || {},
    Ah =
      Oh.now ||
      Oh.mozNow ||
      Oh.msNow ||
      Oh.oNow ||
      Oh.webkitNow ||
      function() {
        return new Date().getTime()
      }
  var Dh = new Date()
  var Nh = {
      nextTick: function(e) {
        var t = new Array(arguments.length - 1)
        if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]
        hh.push(new _h(e, t)), 1 !== hh.length || fh || lh(mh)
      },
      title: 'browser',
      browser: !0,
      env: {},
      argv: [],
      version: '',
      versions: {},
      on: vh,
      addListener: Eh,
      once: Sh,
      off: Ih,
      removeListener: Ch,
      removeAllListeners: Th,
      emit: Mh,
      binding: function(e) {
        throw new Error('process.binding is not supported')
      },
      cwd: function() {
        return '/'
      },
      chdir: function(e) {
        throw new Error('process.chdir is not supported')
      },
      umask: function() {
        return 0
      },
      hrtime: function(e) {
        var t = 0.001 * Ah.call(Oh),
          n = Math.floor(t),
          r = Math.floor((t % 1) * 1e9)
        return e && ((n -= e[0]), (r -= e[1]) < 0 && (n--, (r += 1e9))), [n, r]
      },
      platform: 'browser',
      release: {},
      config: {},
      uptime: function() {
        return (new Date() - Dh) / 1e3
      }
    },
    Rh = function(e, t) {
      Zp.forEach(e, function(n, r) {
        r !== t && r.toUpperCase() === t.toUpperCase() && ((e[t] = n), delete e[r])
      })
    },
    Lh = function(e, t, n, r, o) {
      return (function(e, t, n, r, o) {
        return (
          (e.config = t),
          n && (e.code = n),
          (e.request = r),
          (e.response = o),
          (e.isAxiosError = !0),
          (e.toJSON = function() {
            return {
              message: this.message,
              name: this.name,
              description: this.description,
              number: this.number,
              fileName: this.fileName,
              lineNumber: this.lineNumber,
              columnNumber: this.columnNumber,
              stack: this.stack,
              config: this.config,
              code: this.code
            }
          }),
          e
        )
      })(new Error(e), t, n, r, o)
    },
    Ph = [
      'age',
      'authorization',
      'content-length',
      'content-type',
      'etag',
      'expires',
      'from',
      'host',
      'if-modified-since',
      'if-unmodified-since',
      'last-modified',
      'location',
      'max-forwards',
      'proxy-authorization',
      'referer',
      'retry-after',
      'user-agent'
    ],
    kh = Zp.isStandardBrowserEnv()
      ? (function() {
          var e,
            t = /(msie|trident)/i.test(navigator.userAgent),
            n = document.createElement('a')
          function r(e) {
            var r = e
            return (
              t && (n.setAttribute('href', r), (r = n.href)),
              n.setAttribute('href', r),
              {
                href: n.href,
                protocol: n.protocol ? n.protocol.replace(/:$/, '') : '',
                host: n.host,
                search: n.search ? n.search.replace(/^\?/, '') : '',
                hash: n.hash ? n.hash.replace(/^#/, '') : '',
                hostname: n.hostname,
                port: n.port,
                pathname: '/' === n.pathname.charAt(0) ? n.pathname : '/' + n.pathname
              }
            )
          }
          return (
            (e = r(window.location.href)),
            function(t) {
              var n = Zp.isString(t) ? r(t) : t
              return n.protocol === e.protocol && n.host === e.host
            }
          )
        })()
      : function() {
          return !0
        },
    Gh = Zp.isStandardBrowserEnv()
      ? {
          write: function(e, t, n, r, o, i) {
            var a = []
            a.push(e + '=' + encodeURIComponent(t)),
              Zp.isNumber(n) && a.push('expires=' + new Date(n).toGMTString()),
              Zp.isString(r) && a.push('path=' + r),
              Zp.isString(o) && a.push('domain=' + o),
              !0 === i && a.push('secure'),
              (document.cookie = a.join('; '))
          },
          read: function(e) {
            var t = document.cookie.match(new RegExp('(^|;\\s*)(' + e + ')=([^;]*)'))
            return t ? decodeURIComponent(t[3]) : null
          },
          remove: function(e) {
            this.write(e, '', Date.now() - 864e5)
          }
        }
      : {
          write: function() {},
          read: function() {
            return null
          },
          remove: function() {}
        },
    wh = function(e) {
      return new Promise(function(t, n) {
        var r = e.data,
          o = e.headers
        Zp.isFormData(r) && delete o['Content-Type']
        var i = new XMLHttpRequest()
        if (e.auth) {
          var a = e.auth.username || '',
            s = e.auth.password || ''
          o.Authorization = 'Basic ' + btoa(a + ':' + s)
        }
        if (
          (i.open(e.method.toUpperCase(), th(e.url, e.params, e.paramsSerializer), !0),
          (i.timeout = e.timeout),
          (i.onreadystatechange = function() {
            if (
              i &&
              4 === i.readyState &&
              (0 !== i.status || (i.responseURL && 0 === i.responseURL.indexOf('file:')))
            ) {
              var r =
                  'getAllResponseHeaders' in i
                    ? (function(e) {
                        var t,
                          n,
                          r,
                          o = {}
                        return e
                          ? (Zp.forEach(e.split('\n'), function(e) {
                              if (
                                ((r = e.indexOf(':')),
                                (t = Zp.trim(e.substr(0, r)).toLowerCase()),
                                (n = Zp.trim(e.substr(r + 1))),
                                t)
                              ) {
                                if (o[t] && Ph.indexOf(t) >= 0) return
                                o[t] =
                                  'set-cookie' === t
                                    ? (o[t] ? o[t] : []).concat([n])
                                    : o[t]
                                    ? o[t] + ', ' + n
                                    : n
                              }
                            }),
                            o)
                          : o
                      })(i.getAllResponseHeaders())
                    : null,
                o = {
                  data: e.responseType && 'text' !== e.responseType ? i.response : i.responseText,
                  status: i.status,
                  statusText: i.statusText,
                  headers: r,
                  config: e,
                  request: i
                }
              !(function(e, t, n) {
                var r = n.config.validateStatus
                !r || r(n.status)
                  ? e(n)
                  : t(
                      Lh(
                        'Request failed with status code ' + n.status,
                        n.config,
                        null,
                        n.request,
                        n
                      )
                    )
              })(t, n, o),
                (i = null)
            }
          }),
          (i.onabort = function() {
            i && (n(Lh('Request aborted', e, 'ECONNABORTED', i)), (i = null))
          }),
          (i.onerror = function() {
            n(Lh('Network Error', e, null, i)), (i = null)
          }),
          (i.ontimeout = function() {
            n(Lh('timeout of ' + e.timeout + 'ms exceeded', e, 'ECONNABORTED', i)), (i = null)
          }),
          Zp.isStandardBrowserEnv())
        ) {
          var u = Gh,
            c =
              (e.withCredentials || kh(e.url)) && e.xsrfCookieName
                ? u.read(e.xsrfCookieName)
                : void 0
          c && (o[e.xsrfHeaderName] = c)
        }
        if (
          ('setRequestHeader' in i &&
            Zp.forEach(o, function(e, t) {
              void 0 === r && 'content-type' === t.toLowerCase()
                ? delete o[t]
                : i.setRequestHeader(t, e)
            }),
          e.withCredentials && (i.withCredentials = !0),
          e.responseType)
        )
          try {
            i.responseType = e.responseType
          } catch (l) {
            if ('json' !== e.responseType) throw l
          }
        'function' == typeof e.onDownloadProgress &&
          i.addEventListener('progress', e.onDownloadProgress),
          'function' == typeof e.onUploadProgress &&
            i.upload &&
            i.upload.addEventListener('progress', e.onUploadProgress),
          e.cancelToken &&
            e.cancelToken.promise.then(function(e) {
              i && (i.abort(), n(e), (i = null))
            }),
          void 0 === r && (r = null),
          i.send(r)
      })
    },
    bh = { 'Content-Type': 'application/x-www-form-urlencoded' }
  function Uh(e, t) {
    !Zp.isUndefined(e) && Zp.isUndefined(e['Content-Type']) && (e['Content-Type'] = t)
  }
  var xh,
    Fh = {
      adapter:
        (void 0 !== Nh && '[object process]' === Object.prototype.toString.call(Nh)
          ? (xh = wh)
          : 'undefined' != typeof XMLHttpRequest && (xh = wh),
        xh),
      transformRequest: [
        function(e, t) {
          return (
            Rh(t, 'Accept'),
            Rh(t, 'Content-Type'),
            Zp.isFormData(e) ||
            Zp.isArrayBuffer(e) ||
            Zp.isBuffer(e) ||
            Zp.isStream(e) ||
            Zp.isFile(e) ||
            Zp.isBlob(e)
              ? e
              : Zp.isArrayBufferView(e)
              ? e.buffer
              : Zp.isURLSearchParams(e)
              ? (Uh(t, 'application/x-www-form-urlencoded;charset=utf-8'), e.toString())
              : Zp.isObject(e)
              ? (Uh(t, 'application/json;charset=utf-8'), JSON.stringify(e))
              : e
          )
        }
      ],
      transformResponse: [
        function(e) {
          if ('string' == typeof e)
            try {
              e = JSON.parse(e)
            } catch (t) {}
          return e
        }
      ],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      validateStatus: function(e) {
        return e >= 200 && e < 300
      }
    }
  ;(Fh.headers = { common: { Accept: 'application/json, text/plain, */*' } }),
    Zp.forEach(['delete', 'get', 'head'], function(e) {
      Fh.headers[e] = {}
    }),
    Zp.forEach(['post', 'put', 'patch'], function(e) {
      Fh.headers[e] = Zp.merge(bh)
    })
  var qh = Fh
  function Vh(e) {
    e.cancelToken && e.cancelToken.throwIfRequested()
  }
  var Kh = function(e) {
      var t, n, r
      return (
        Vh(e),
        e.baseURL &&
          ((r = e.url), !/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(r)) &&
          (e.url =
            ((t = e.baseURL),
            (n = e.url) ? t.replace(/\/+$/, '') + '/' + n.replace(/^\/+/, '') : t)),
        (e.headers = e.headers || {}),
        (e.data = oh(e.data, e.headers, e.transformRequest)),
        (e.headers = Zp.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {})),
        Zp.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function(t) {
          delete e.headers[t]
        }),
        (e.adapter || qh.adapter)(e).then(
          function(t) {
            return Vh(e), (t.data = oh(t.data, t.headers, e.transformResponse)), t
          },
          function(t) {
            return (
              ih(t) ||
                (Vh(e),
                t &&
                  t.response &&
                  (t.response.data = oh(t.response.data, t.response.headers, e.transformResponse))),
              Promise.reject(t)
            )
          }
        )
      )
    },
    Bh = function(e, t) {
      t = t || {}
      var n = {}
      return (
        Zp.forEach(['url', 'method', 'params', 'data'], function(e) {
          void 0 !== t[e] && (n[e] = t[e])
        }),
        Zp.forEach(['headers', 'auth', 'proxy'], function(r) {
          Zp.isObject(t[r])
            ? (n[r] = Zp.deepMerge(e[r], t[r]))
            : void 0 !== t[r]
            ? (n[r] = t[r])
            : Zp.isObject(e[r])
            ? (n[r] = Zp.deepMerge(e[r]))
            : void 0 !== e[r] && (n[r] = e[r])
        }),
        Zp.forEach(
          [
            'baseURL',
            'transformRequest',
            'transformResponse',
            'paramsSerializer',
            'timeout',
            'withCredentials',
            'adapter',
            'responseType',
            'xsrfCookieName',
            'xsrfHeaderName',
            'onUploadProgress',
            'onDownloadProgress',
            'maxContentLength',
            'validateStatus',
            'maxRedirects',
            'httpAgent',
            'httpsAgent',
            'cancelToken',
            'socketPath'
          ],
          function(r) {
            void 0 !== t[r] ? (n[r] = t[r]) : void 0 !== e[r] && (n[r] = e[r])
          }
        ),
        n
      )
    }
  function Hh(e) {
    ;(this.defaults = e), (this.interceptors = { request: new rh(), response: new rh() })
  }
  ;(Hh.prototype.request = function(e) {
    'string' == typeof e ? ((e = arguments[1] || {}).url = arguments[0]) : (e = e || {}),
      ((e = Bh(this.defaults, e)).method = e.method ? e.method.toLowerCase() : 'get')
    var t = [Kh, void 0],
      n = Promise.resolve(e)
    for (
      this.interceptors.request.forEach(function(e) {
        t.unshift(e.fulfilled, e.rejected)
      }),
        this.interceptors.response.forEach(function(e) {
          t.push(e.fulfilled, e.rejected)
        });
      t.length;

    )
      n = n.then(t.shift(), t.shift())
    return n
  }),
    (Hh.prototype.getUri = function(e) {
      return (e = Bh(this.defaults, e)), th(e.url, e.params, e.paramsSerializer).replace(/^\?/, '')
    }),
    Zp.forEach(['delete', 'get', 'head', 'options'], function(e) {
      Hh.prototype[e] = function(t, n) {
        return this.request(Zp.merge(n || {}, { method: e, url: t }))
      }
    }),
    Zp.forEach(['post', 'put', 'patch'], function(e) {
      Hh.prototype[e] = function(t, n, r) {
        return this.request(Zp.merge(r || {}, { method: e, url: t, data: n }))
      }
    })
  var jh = Hh
  function Yh(e) {
    this.message = e
  }
  ;(Yh.prototype.toString = function() {
    return 'Cancel' + (this.message ? ': ' + this.message : '')
  }),
    (Yh.prototype.__CANCEL__ = !0)
  var $h = Yh
  function Wh(e) {
    if ('function' != typeof e) throw new TypeError('executor must be a function.')
    var t
    this.promise = new Promise(function(e) {
      t = e
    })
    var n = this
    e(function(e) {
      n.reason || ((n.reason = new $h(e)), t(n.reason))
    })
  }
  ;(Wh.prototype.throwIfRequested = function() {
    if (this.reason) throw this.reason
  }),
    (Wh.source = function() {
      var e
      return {
        token: new Wh(function(t) {
          e = t
        }),
        cancel: e
      }
    })
  var zh = Wh
  function Xh(e) {
    var t = new jh(e),
      n = $p(jh.prototype.request, t)
    return Zp.extend(n, jh.prototype, t), Zp.extend(n, t), n
  }
  var Jh = Xh(qh)
  ;(Jh.Axios = jh),
    (Jh.create = function(e) {
      return Xh(Bh(Jh.defaults, e))
    }),
    (Jh.Cancel = $h),
    (Jh.CancelToken = zh),
    (Jh.isCancel = ih),
    (Jh.all = function(e) {
      return Promise.all(e)
    }),
    (Jh.spread = function(e) {
      return function(t) {
        return e.apply(null, t)
      }
    })
  var Qh = Jh,
    Zh = Jh
  Qh.default = Zh
  var ef = Qh,
    tf = ef.create({
      timeout: 6e3,
      headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }
    })
  tf.interceptors.response.use(
    function(e) {
      var t = e.data,
        n = t.error_code,
        r = t.ErrorCode
      return xs(n) && (r = n), r !== yu.REQUEST.SUCCESS && (e.data.ErrorCode = Number(r)), e
    },
    function(e) {
      return (
        'Network Error' === e.message &&
          (!0 === tf.defaults.withCredentials &&
            Gs.warn(
              'Network Error, try to close `IMAxios.defaults.withCredentials` to false. (IMAxios.js)'
            ),
          (tf.defaults.withCredentials = !1)),
        Promise.reject(e)
      )
    }
  )
  var nf = (function() {
      function e() {
        In(this, e)
      }
      return (
        Tn(e, [
          {
            key: 'request',
            value: function(e) {
              console.warn('请注意： ConnectionBase.request() 方法必须被派生类重写:'),
                console.log(
                  '参数如下：\n    * @param {String} options.url string 是 开发者服务器接口地址\n    * @param {*} options.data - string/object/ArrayBuffer 否 请求的参数\n    * @param {Object} options.header - Object 否 设置请求的 header，\n    * @param {String} options.method - string GET 否 HTTP 请求方法\n    * @param {String} options.dataType - string json 否 返回的数据格式\n    * @param {String} options.responseType - string text 否 响应的数据类型\n    * @param {Boolean} isRetry - string text false 是否为重试的请求\n   '
                )
            }
          },
          {
            key: '_checkOptions',
            value: function(e) {
              if (!1 == !!e.url)
                throw new np({
                  code: rp.NETWORK_BASE_OPTIONS_NO_URL,
                  message: op.NETWORK_BASE_OPTIONS_NO_URL
                })
            }
          },
          {
            key: '_initOptions',
            value: function(e) {
              ;(e.method =
                ['POST', 'GET', 'PUT', 'DELETE', 'OPTION'].indexOf(e.method) >= 0
                  ? e.method
                  : 'POST'),
                (e.dataType = e.dataType || 'json'),
                (e.responseType = e.responseType || 'json')
            }
          }
        ]),
        e
      )
    })(),
    rf = (function(e) {
      function t() {
        var e
        return In(this, t), ((e = Gn(this, Nn(t).call(this))).retry = 2), e
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'request',
            value: function(e) {
              return (
                this._checkOptions(e),
                this._initOptions(e),
                this._requestWithRetry({ url: e.url, data: e.data, method: e.method })
              )
            }
          },
          {
            key: '_requestWithRetry',
            value: function(e) {
              var t = this,
                n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
              return tf(e).catch(function(r) {
                return t.retry && n < t.retry
                  ? t._requestWithRetry(e, ++n)
                  : Kp(new np({ code: r.code || '', message: r.message || '' }))
              })
            }
          }
        ]),
        t
      )
    })(nf),
    of = [],
    af = [],
    sf = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
    uf = !1
  function cf() {
    uf = !0
    for (
      var e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
        t = 0,
        n = e.length;
      t < n;
      ++t
    )
      (of[t] = e[t]), (af[e.charCodeAt(t)] = t)
    ;(af['-'.charCodeAt(0)] = 62), (af['_'.charCodeAt(0)] = 63)
  }
  function lf(e, t, n) {
    for (var r, o, i = [], a = t; a < n; a += 3)
      (r = (e[a] << 16) + (e[a + 1] << 8) + e[a + 2]),
        i.push(of[((o = r) >> 18) & 63] + of[(o >> 12) & 63] + of[(o >> 6) & 63] + of[63 & o])
    return i.join('')
  }
  function pf(e) {
    var t
    uf || cf()
    for (var n = e.length, r = n % 3, o = '', i = [], a = 0, s = n - r; a < s; a += 16383)
      i.push(lf(e, a, a + 16383 > s ? s : a + 16383))
    return (
      1 === r
        ? ((t = e[n - 1]), (o += of[t >> 2]), (o += of[(t << 4) & 63]), (o += '=='))
        : 2 === r &&
          ((t = (e[n - 2] << 8) + e[n - 1]),
          (o += of[t >> 10]),
          (o += of[(t >> 4) & 63]),
          (o += of[(t << 2) & 63]),
          (o += '=')),
      i.push(o),
      i.join('')
    )
  }
  function hf(e, t, n, r, o) {
    var i,
      a,
      s = 8 * o - r - 1,
      u = (1 << s) - 1,
      c = u >> 1,
      l = -7,
      p = n ? o - 1 : 0,
      h = n ? -1 : 1,
      f = e[t + p]
    for (
      p += h, i = f & ((1 << -l) - 1), f >>= -l, l += s;
      l > 0;
      i = 256 * i + e[t + p], p += h, l -= 8
    );
    for (a = i & ((1 << -l) - 1), i >>= -l, l += r; l > 0; a = 256 * a + e[t + p], p += h, l -= 8);
    if (0 === i) i = 1 - c
    else {
      if (i === u) return a ? NaN : Infinity * (f ? -1 : 1)
      ;(a += Math.pow(2, r)), (i -= c)
    }
    return (f ? -1 : 1) * a * Math.pow(2, i - r)
  }
  function ff(e, t, n, r, o, i) {
    var a,
      s,
      u,
      c = 8 * i - o - 1,
      l = (1 << c) - 1,
      p = l >> 1,
      h = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
      f = r ? 0 : i - 1,
      g = r ? 1 : -1,
      d = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
    for (
      t = Math.abs(t),
        isNaN(t) || Infinity === t
          ? ((s = isNaN(t) ? 1 : 0), (a = l))
          : ((a = Math.floor(Math.log(t) / Math.LN2)),
            t * (u = Math.pow(2, -a)) < 1 && (a--, (u *= 2)),
            (t += a + p >= 1 ? h / u : h * Math.pow(2, 1 - p)) * u >= 2 && (a++, (u /= 2)),
            a + p >= l
              ? ((s = 0), (a = l))
              : a + p >= 1
              ? ((s = (t * u - 1) * Math.pow(2, o)), (a += p))
              : ((s = t * Math.pow(2, p - 1) * Math.pow(2, o)), (a = 0)));
      o >= 8;
      e[n + f] = 255 & s, f += g, s /= 256, o -= 8
    );
    for (a = (a << o) | s, c += o; c > 0; e[n + f] = 255 & a, f += g, a /= 256, c -= 8);
    e[n + f - g] |= 128 * d
  }
  var gf = {}.toString,
    df =
      Array.isArray ||
      function(e) {
        return '[object Array]' == gf.call(e)
      }
  function mf() {
    return yf.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  }
  function _f(e, t) {
    if (mf() < t) throw new RangeError('Invalid typed array length')
    return (
      yf.TYPED_ARRAY_SUPPORT
        ? ((e = new Uint8Array(t)).__proto__ = yf.prototype)
        : (null === e && (e = new yf(t)), (e.length = t)),
      e
    )
  }
  function yf(e, t, n) {
    if (!(yf.TYPED_ARRAY_SUPPORT || this instanceof yf)) return new yf(e, t, n)
    if ('number' == typeof e) {
      if ('string' == typeof t)
        throw new Error('If encoding is specified then the first argument must be a string')
      return Sf(this, e)
    }
    return vf(this, e, t, n)
  }
  function vf(e, t, n, r) {
    if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
    return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
      ? (function(e, t, n, r) {
          if ((t.byteLength, n < 0 || t.byteLength < n))
            throw new RangeError("'offset' is out of bounds")
          if (t.byteLength < n + (r || 0)) throw new RangeError("'length' is out of bounds")
          t =
            void 0 === n && void 0 === r
              ? new Uint8Array(t)
              : void 0 === r
              ? new Uint8Array(t, n)
              : new Uint8Array(t, n, r)
          yf.TYPED_ARRAY_SUPPORT ? ((e = t).__proto__ = yf.prototype) : (e = If(e, t))
          return e
        })(e, t, n, r)
      : 'string' == typeof t
      ? (function(e, t, n) {
          ;('string' == typeof n && '' !== n) || (n = 'utf8')
          if (!yf.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding')
          var r = 0 | Mf(t, n),
            o = (e = _f(e, r)).write(t, n)
          o !== r && (e = e.slice(0, o))
          return e
        })(e, t, n)
      : (function(e, t) {
          if (Tf(t)) {
            var n = 0 | Cf(t.length)
            return 0 === (e = _f(e, n)).length ? e : (t.copy(e, 0, 0, n), e)
          }
          if (t) {
            if (
              ('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) ||
              'length' in t
            )
              return 'number' != typeof t.length || (r = t.length) != r ? _f(e, 0) : If(e, t)
            if ('Buffer' === t.type && df(t.data)) return If(e, t.data)
          }
          var r
          throw new TypeError(
            'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'
          )
        })(e, t)
  }
  function Ef(e) {
    if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
    if (e < 0) throw new RangeError('"size" argument must not be negative')
  }
  function Sf(e, t) {
    if ((Ef(t), (e = _f(e, t < 0 ? 0 : 0 | Cf(t))), !yf.TYPED_ARRAY_SUPPORT))
      for (var n = 0; n < t; ++n) e[n] = 0
    return e
  }
  function If(e, t) {
    var n = t.length < 0 ? 0 : 0 | Cf(t.length)
    e = _f(e, n)
    for (var r = 0; r < n; r += 1) e[r] = 255 & t[r]
    return e
  }
  function Cf(e) {
    if (e >= mf())
      throw new RangeError(
        'Attempt to allocate Buffer larger than maximum size: 0x' + mf().toString(16) + ' bytes'
      )
    return 0 | e
  }
  function Tf(e) {
    return !(null == e || !e._isBuffer)
  }
  function Mf(e, t) {
    if (Tf(e)) return e.length
    if (
      'undefined' != typeof ArrayBuffer &&
      'function' == typeof ArrayBuffer.isView &&
      (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
    )
      return e.byteLength
    'string' != typeof e && (e = '' + e)
    var n = e.length
    if (0 === n) return 0
    for (var r = !1; ; )
      switch (t) {
        case 'ascii':
        case 'latin1':
        case 'binary':
          return n
        case 'utf8':
        case 'utf-8':
        case void 0:
          return Qf(e).length
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return 2 * n
        case 'hex':
          return n >>> 1
        case 'base64':
          return Zf(e).length
        default:
          if (r) return Qf(e).length
          ;(t = ('' + t).toLowerCase()), (r = !0)
      }
  }
  function Of(e, t, n) {
    var r = !1
    if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
    if (((void 0 === n || n > this.length) && (n = this.length), n <= 0)) return ''
    if ((n >>>= 0) <= (t >>>= 0)) return ''
    for (e || (e = 'utf8'); ; )
      switch (e) {
        case 'hex':
          return Vf(this, t, n)
        case 'utf8':
        case 'utf-8':
          return Uf(this, t, n)
        case 'ascii':
          return Ff(this, t, n)
        case 'latin1':
        case 'binary':
          return qf(this, t, n)
        case 'base64':
          return bf(this, t, n)
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return Kf(this, t, n)
        default:
          if (r) throw new TypeError('Unknown encoding: ' + e)
          ;(e = (e + '').toLowerCase()), (r = !0)
      }
  }
  function Af(e, t, n) {
    var r = e[t]
    ;(e[t] = e[n]), (e[n] = r)
  }
  function Df(e, t, n, r, o) {
    if (0 === e.length) return -1
    if (
      ('string' == typeof n
        ? ((r = n), (n = 0))
        : n > 2147483647
        ? (n = 2147483647)
        : n < -2147483648 && (n = -2147483648),
      (n = +n),
      isNaN(n) && (n = o ? 0 : e.length - 1),
      n < 0 && (n = e.length + n),
      n >= e.length)
    ) {
      if (o) return -1
      n = e.length - 1
    } else if (n < 0) {
      if (!o) return -1
      n = 0
    }
    if (('string' == typeof t && (t = yf.from(t, r)), Tf(t)))
      return 0 === t.length ? -1 : Nf(e, t, n, r, o)
    if ('number' == typeof t)
      return (
        (t &= 255),
        yf.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
          ? o
            ? Uint8Array.prototype.indexOf.call(e, t, n)
            : Uint8Array.prototype.lastIndexOf.call(e, t, n)
          : Nf(e, [t], n, r, o)
      )
    throw new TypeError('val must be string, number or Buffer')
  }
  function Nf(e, t, n, r, o) {
    var i,
      a = 1,
      s = e.length,
      u = t.length
    if (
      void 0 !== r &&
      ('ucs2' === (r = String(r).toLowerCase()) ||
        'ucs-2' === r ||
        'utf16le' === r ||
        'utf-16le' === r)
    ) {
      if (e.length < 2 || t.length < 2) return -1
      ;(a = 2), (s /= 2), (u /= 2), (n /= 2)
    }
    function c(e, t) {
      return 1 === a ? e[t] : e.readUInt16BE(t * a)
    }
    if (o) {
      var l = -1
      for (i = n; i < s; i++)
        if (c(e, i) === c(t, -1 === l ? 0 : i - l)) {
          if ((-1 === l && (l = i), i - l + 1 === u)) return l * a
        } else -1 !== l && (i -= i - l), (l = -1)
    } else
      for (n + u > s && (n = s - u), i = n; i >= 0; i--) {
        for (var p = !0, h = 0; h < u; h++)
          if (c(e, i + h) !== c(t, h)) {
            p = !1
            break
          }
        if (p) return i
      }
    return -1
  }
  function Rf(e, t, n, r) {
    n = Number(n) || 0
    var o = e.length - n
    r ? (r = Number(r)) > o && (r = o) : (r = o)
    var i = t.length
    if (i % 2 != 0) throw new TypeError('Invalid hex string')
    r > i / 2 && (r = i / 2)
    for (var a = 0; a < r; ++a) {
      var s = parseInt(t.substr(2 * a, 2), 16)
      if (isNaN(s)) return a
      e[n + a] = s
    }
    return a
  }
  function Lf(e, t, n, r) {
    return eg(Qf(t, e.length - n), e, n, r)
  }
  function Pf(e, t, n, r) {
    return eg(
      (function(e) {
        for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n))
        return t
      })(t),
      e,
      n,
      r
    )
  }
  function kf(e, t, n, r) {
    return Pf(e, t, n, r)
  }
  function Gf(e, t, n, r) {
    return eg(Zf(t), e, n, r)
  }
  function wf(e, t, n, r) {
    return eg(
      (function(e, t) {
        for (var n, r, o, i = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
          (n = e.charCodeAt(a)), (r = n >> 8), (o = n % 256), i.push(o), i.push(r)
        return i
      })(t, e.length - n),
      e,
      n,
      r
    )
  }
  function bf(e, t, n) {
    return 0 === t && n === e.length ? pf(e) : pf(e.slice(t, n))
  }
  function Uf(e, t, n) {
    n = Math.min(e.length, n)
    for (var r = [], o = t; o < n; ) {
      var i,
        a,
        s,
        u,
        c = e[o],
        l = null,
        p = c > 239 ? 4 : c > 223 ? 3 : c > 191 ? 2 : 1
      if (o + p <= n)
        switch (p) {
          case 1:
            c < 128 && (l = c)
            break
          case 2:
            128 == (192 & (i = e[o + 1])) && (u = ((31 & c) << 6) | (63 & i)) > 127 && (l = u)
            break
          case 3:
            ;(i = e[o + 1]),
              (a = e[o + 2]),
              128 == (192 & i) &&
                128 == (192 & a) &&
                (u = ((15 & c) << 12) | ((63 & i) << 6) | (63 & a)) > 2047 &&
                (u < 55296 || u > 57343) &&
                (l = u)
            break
          case 4:
            ;(i = e[o + 1]),
              (a = e[o + 2]),
              (s = e[o + 3]),
              128 == (192 & i) &&
                128 == (192 & a) &&
                128 == (192 & s) &&
                (u = ((15 & c) << 18) | ((63 & i) << 12) | ((63 & a) << 6) | (63 & s)) > 65535 &&
                u < 1114112 &&
                (l = u)
        }
      null === l
        ? ((l = 65533), (p = 1))
        : l > 65535 &&
          ((l -= 65536), r.push(((l >>> 10) & 1023) | 55296), (l = 56320 | (1023 & l))),
        r.push(l),
        (o += p)
    }
    return (function(e) {
      var t = e.length
      if (t <= xf) return String.fromCharCode.apply(String, e)
      var n = '',
        r = 0
      for (; r < t; ) n += String.fromCharCode.apply(String, e.slice(r, (r += xf)))
      return n
    })(r)
  }
  ;(yf.TYPED_ARRAY_SUPPORT = void 0 === Ms.TYPED_ARRAY_SUPPORT || Ms.TYPED_ARRAY_SUPPORT),
    (yf.poolSize = 8192),
    (yf._augment = function(e) {
      return (e.__proto__ = yf.prototype), e
    }),
    (yf.from = function(e, t, n) {
      return vf(null, e, t, n)
    }),
    yf.TYPED_ARRAY_SUPPORT &&
      ((yf.prototype.__proto__ = Uint8Array.prototype), (yf.__proto__ = Uint8Array)),
    (yf.alloc = function(e, t, n) {
      return (function(e, t, n, r) {
        return (
          Ef(t),
          t <= 0
            ? _f(e, t)
            : void 0 !== n
            ? 'string' == typeof r
              ? _f(e, t).fill(n, r)
              : _f(e, t).fill(n)
            : _f(e, t)
        )
      })(null, e, t, n)
    }),
    (yf.allocUnsafe = function(e) {
      return Sf(null, e)
    }),
    (yf.allocUnsafeSlow = function(e) {
      return Sf(null, e)
    }),
    (yf.isBuffer = function(e) {
      return (
        null != e &&
        (!!e._isBuffer ||
          tg(e) ||
          (function(e) {
            return (
              'function' == typeof e.readFloatLE &&
              'function' == typeof e.slice &&
              tg(e.slice(0, 0))
            )
          })(e))
      )
    }),
    (yf.compare = function(e, t) {
      if (!Tf(e) || !Tf(t)) throw new TypeError('Arguments must be Buffers')
      if (e === t) return 0
      for (var n = e.length, r = t.length, o = 0, i = Math.min(n, r); o < i; ++o)
        if (e[o] !== t[o]) {
          ;(n = e[o]), (r = t[o])
          break
        }
      return n < r ? -1 : r < n ? 1 : 0
    }),
    (yf.isEncoding = function(e) {
      switch (String(e).toLowerCase()) {
        case 'hex':
        case 'utf8':
        case 'utf-8':
        case 'ascii':
        case 'latin1':
        case 'binary':
        case 'base64':
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return !0
        default:
          return !1
      }
    }),
    (yf.concat = function(e, t) {
      if (!df(e)) throw new TypeError('"list" argument must be an Array of Buffers')
      if (0 === e.length) return yf.alloc(0)
      var n
      if (void 0 === t) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length
      var r = yf.allocUnsafe(t),
        o = 0
      for (n = 0; n < e.length; ++n) {
        var i = e[n]
        if (!Tf(i)) throw new TypeError('"list" argument must be an Array of Buffers')
        i.copy(r, o), (o += i.length)
      }
      return r
    }),
    (yf.byteLength = Mf),
    (yf.prototype._isBuffer = !0),
    (yf.prototype.swap16 = function() {
      var e = this.length
      if (e % 2 != 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
      for (var t = 0; t < e; t += 2) Af(this, t, t + 1)
      return this
    }),
    (yf.prototype.swap32 = function() {
      var e = this.length
      if (e % 4 != 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
      for (var t = 0; t < e; t += 4) Af(this, t, t + 3), Af(this, t + 1, t + 2)
      return this
    }),
    (yf.prototype.swap64 = function() {
      var e = this.length
      if (e % 8 != 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
      for (var t = 0; t < e; t += 8)
        Af(this, t, t + 7), Af(this, t + 1, t + 6), Af(this, t + 2, t + 5), Af(this, t + 3, t + 4)
      return this
    }),
    (yf.prototype.toString = function() {
      var e = 0 | this.length
      return 0 === e ? '' : 0 === arguments.length ? Uf(this, 0, e) : Of.apply(this, arguments)
    }),
    (yf.prototype.equals = function(e) {
      if (!Tf(e)) throw new TypeError('Argument must be a Buffer')
      return this === e || 0 === yf.compare(this, e)
    }),
    (yf.prototype.inspect = function() {
      var e = ''
      return (
        this.length > 0 &&
          ((e = this.toString('hex', 0, 50)
            .match(/.{2}/g)
            .join(' ')),
          this.length > 50 && (e += ' ... ')),
        '<Buffer ' + e + '>'
      )
    }),
    (yf.prototype.compare = function(e, t, n, r, o) {
      if (!Tf(e)) throw new TypeError('Argument must be a Buffer')
      if (
        (void 0 === t && (t = 0),
        void 0 === n && (n = e ? e.length : 0),
        void 0 === r && (r = 0),
        void 0 === o && (o = this.length),
        t < 0 || n > e.length || r < 0 || o > this.length)
      )
        throw new RangeError('out of range index')
      if (r >= o && t >= n) return 0
      if (r >= o) return -1
      if (t >= n) return 1
      if (this === e) return 0
      for (
        var i = (o >>>= 0) - (r >>>= 0),
          a = (n >>>= 0) - (t >>>= 0),
          s = Math.min(i, a),
          u = this.slice(r, o),
          c = e.slice(t, n),
          l = 0;
        l < s;
        ++l
      )
        if (u[l] !== c[l]) {
          ;(i = u[l]), (a = c[l])
          break
        }
      return i < a ? -1 : a < i ? 1 : 0
    }),
    (yf.prototype.includes = function(e, t, n) {
      return -1 !== this.indexOf(e, t, n)
    }),
    (yf.prototype.indexOf = function(e, t, n) {
      return Df(this, e, t, n, !0)
    }),
    (yf.prototype.lastIndexOf = function(e, t, n) {
      return Df(this, e, t, n, !1)
    }),
    (yf.prototype.write = function(e, t, n, r) {
      if (void 0 === t) (r = 'utf8'), (n = this.length), (t = 0)
      else if (void 0 === n && 'string' == typeof t) (r = t), (n = this.length), (t = 0)
      else {
        if (!isFinite(t))
          throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported')
        ;(t |= 0), isFinite(n) ? ((n |= 0), void 0 === r && (r = 'utf8')) : ((r = n), (n = void 0))
      }
      var o = this.length - t
      if (
        ((void 0 === n || n > o) && (n = o), (e.length > 0 && (n < 0 || t < 0)) || t > this.length)
      )
        throw new RangeError('Attempt to write outside buffer bounds')
      r || (r = 'utf8')
      for (var i = !1; ; )
        switch (r) {
          case 'hex':
            return Rf(this, e, t, n)
          case 'utf8':
          case 'utf-8':
            return Lf(this, e, t, n)
          case 'ascii':
            return Pf(this, e, t, n)
          case 'latin1':
          case 'binary':
            return kf(this, e, t, n)
          case 'base64':
            return Gf(this, e, t, n)
          case 'ucs2':
          case 'ucs-2':
          case 'utf16le':
          case 'utf-16le':
            return wf(this, e, t, n)
          default:
            if (i) throw new TypeError('Unknown encoding: ' + r)
            ;(r = ('' + r).toLowerCase()), (i = !0)
        }
    }),
    (yf.prototype.toJSON = function() {
      return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) }
    })
  var xf = 4096
  function Ff(e, t, n) {
    var r = ''
    n = Math.min(e.length, n)
    for (var o = t; o < n; ++o) r += String.fromCharCode(127 & e[o])
    return r
  }
  function qf(e, t, n) {
    var r = ''
    n = Math.min(e.length, n)
    for (var o = t; o < n; ++o) r += String.fromCharCode(e[o])
    return r
  }
  function Vf(e, t, n) {
    var r = e.length
    ;(!t || t < 0) && (t = 0), (!n || n < 0 || n > r) && (n = r)
    for (var o = '', i = t; i < n; ++i) o += Jf(e[i])
    return o
  }
  function Kf(e, t, n) {
    for (var r = e.slice(t, n), o = '', i = 0; i < r.length; i += 2)
      o += String.fromCharCode(r[i] + 256 * r[i + 1])
    return o
  }
  function Bf(e, t, n) {
    if (e % 1 != 0 || e < 0) throw new RangeError('offset is not uint')
    if (e + t > n) throw new RangeError('Trying to access beyond buffer length')
  }
  function Hf(e, t, n, r, o, i) {
    if (!Tf(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
    if (t > o || t < i) throw new RangeError('"value" argument is out of bounds')
    if (n + r > e.length) throw new RangeError('Index out of range')
  }
  function jf(e, t, n, r) {
    t < 0 && (t = 65535 + t + 1)
    for (var o = 0, i = Math.min(e.length - n, 2); o < i; ++o)
      e[n + o] = (t & (255 << (8 * (r ? o : 1 - o)))) >>> (8 * (r ? o : 1 - o))
  }
  function Yf(e, t, n, r) {
    t < 0 && (t = 4294967295 + t + 1)
    for (var o = 0, i = Math.min(e.length - n, 4); o < i; ++o)
      e[n + o] = (t >>> (8 * (r ? o : 3 - o))) & 255
  }
  function $f(e, t, n, r, o, i) {
    if (n + r > e.length) throw new RangeError('Index out of range')
    if (n < 0) throw new RangeError('Index out of range')
  }
  function Wf(e, t, n, r, o) {
    return o || $f(e, 0, n, 4), ff(e, t, n, r, 23, 4), n + 4
  }
  function zf(e, t, n, r, o) {
    return o || $f(e, 0, n, 8), ff(e, t, n, r, 52, 8), n + 8
  }
  ;(yf.prototype.slice = function(e, t) {
    var n,
      r = this.length
    if (
      ((e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r),
      (t = void 0 === t ? r : ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r),
      t < e && (t = e),
      yf.TYPED_ARRAY_SUPPORT)
    )
      (n = this.subarray(e, t)).__proto__ = yf.prototype
    else {
      var o = t - e
      n = new yf(o, void 0)
      for (var i = 0; i < o; ++i) n[i] = this[i + e]
    }
    return n
  }),
    (yf.prototype.readUIntLE = function(e, t, n) {
      ;(e |= 0), (t |= 0), n || Bf(e, t, this.length)
      for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) r += this[e + i] * o
      return r
    }),
    (yf.prototype.readUIntBE = function(e, t, n) {
      ;(e |= 0), (t |= 0), n || Bf(e, t, this.length)
      for (var r = this[e + --t], o = 1; t > 0 && (o *= 256); ) r += this[e + --t] * o
      return r
    }),
    (yf.prototype.readUInt8 = function(e, t) {
      return t || Bf(e, 1, this.length), this[e]
    }),
    (yf.prototype.readUInt16LE = function(e, t) {
      return t || Bf(e, 2, this.length), this[e] | (this[e + 1] << 8)
    }),
    (yf.prototype.readUInt16BE = function(e, t) {
      return t || Bf(e, 2, this.length), (this[e] << 8) | this[e + 1]
    }),
    (yf.prototype.readUInt32LE = function(e, t) {
      return (
        t || Bf(e, 4, this.length),
        (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
      )
    }),
    (yf.prototype.readUInt32BE = function(e, t) {
      return (
        t || Bf(e, 4, this.length),
        16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
      )
    }),
    (yf.prototype.readIntLE = function(e, t, n) {
      ;(e |= 0), (t |= 0), n || Bf(e, t, this.length)
      for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) r += this[e + i] * o
      return r >= (o *= 128) && (r -= Math.pow(2, 8 * t)), r
    }),
    (yf.prototype.readIntBE = function(e, t, n) {
      ;(e |= 0), (t |= 0), n || Bf(e, t, this.length)
      for (var r = t, o = 1, i = this[e + --r]; r > 0 && (o *= 256); ) i += this[e + --r] * o
      return i >= (o *= 128) && (i -= Math.pow(2, 8 * t)), i
    }),
    (yf.prototype.readInt8 = function(e, t) {
      return t || Bf(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
    }),
    (yf.prototype.readInt16LE = function(e, t) {
      t || Bf(e, 2, this.length)
      var n = this[e] | (this[e + 1] << 8)
      return 32768 & n ? 4294901760 | n : n
    }),
    (yf.prototype.readInt16BE = function(e, t) {
      t || Bf(e, 2, this.length)
      var n = this[e + 1] | (this[e] << 8)
      return 32768 & n ? 4294901760 | n : n
    }),
    (yf.prototype.readInt32LE = function(e, t) {
      return (
        t || Bf(e, 4, this.length),
        this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
      )
    }),
    (yf.prototype.readInt32BE = function(e, t) {
      return (
        t || Bf(e, 4, this.length),
        (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
      )
    }),
    (yf.prototype.readFloatLE = function(e, t) {
      return t || Bf(e, 4, this.length), hf(this, e, !0, 23, 4)
    }),
    (yf.prototype.readFloatBE = function(e, t) {
      return t || Bf(e, 4, this.length), hf(this, e, !1, 23, 4)
    }),
    (yf.prototype.readDoubleLE = function(e, t) {
      return t || Bf(e, 8, this.length), hf(this, e, !0, 52, 8)
    }),
    (yf.prototype.readDoubleBE = function(e, t) {
      return t || Bf(e, 8, this.length), hf(this, e, !1, 52, 8)
    }),
    (yf.prototype.writeUIntLE = function(e, t, n, r) {
      ;((e = +e), (t |= 0), (n |= 0), r) || Hf(this, e, t, n, Math.pow(2, 8 * n) - 1, 0)
      var o = 1,
        i = 0
      for (this[t] = 255 & e; ++i < n && (o *= 256); ) this[t + i] = (e / o) & 255
      return t + n
    }),
    (yf.prototype.writeUIntBE = function(e, t, n, r) {
      ;((e = +e), (t |= 0), (n |= 0), r) || Hf(this, e, t, n, Math.pow(2, 8 * n) - 1, 0)
      var o = n - 1,
        i = 1
      for (this[t + o] = 255 & e; --o >= 0 && (i *= 256); ) this[t + o] = (e / i) & 255
      return t + n
    }),
    (yf.prototype.writeUInt8 = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 1, 255, 0),
        yf.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
        (this[t] = 255 & e),
        t + 1
      )
    }),
    (yf.prototype.writeUInt16LE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 2, 65535, 0),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
          : jf(this, e, t, !0),
        t + 2
      )
    }),
    (yf.prototype.writeUInt16BE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 2, 65535, 0),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
          : jf(this, e, t, !1),
        t + 2
      )
    }),
    (yf.prototype.writeUInt32LE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 4, 4294967295, 0),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t + 3] = e >>> 24),
            (this[t + 2] = e >>> 16),
            (this[t + 1] = e >>> 8),
            (this[t] = 255 & e))
          : Yf(this, e, t, !0),
        t + 4
      )
    }),
    (yf.prototype.writeUInt32BE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 4, 4294967295, 0),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = e >>> 24),
            (this[t + 1] = e >>> 16),
            (this[t + 2] = e >>> 8),
            (this[t + 3] = 255 & e))
          : Yf(this, e, t, !1),
        t + 4
      )
    }),
    (yf.prototype.writeIntLE = function(e, t, n, r) {
      if (((e = +e), (t |= 0), !r)) {
        var o = Math.pow(2, 8 * n - 1)
        Hf(this, e, t, n, o - 1, -o)
      }
      var i = 0,
        a = 1,
        s = 0
      for (this[t] = 255 & e; ++i < n && (a *= 256); )
        e < 0 && 0 === s && 0 !== this[t + i - 1] && (s = 1),
          (this[t + i] = (((e / a) >> 0) - s) & 255)
      return t + n
    }),
    (yf.prototype.writeIntBE = function(e, t, n, r) {
      if (((e = +e), (t |= 0), !r)) {
        var o = Math.pow(2, 8 * n - 1)
        Hf(this, e, t, n, o - 1, -o)
      }
      var i = n - 1,
        a = 1,
        s = 0
      for (this[t + i] = 255 & e; --i >= 0 && (a *= 256); )
        e < 0 && 0 === s && 0 !== this[t + i + 1] && (s = 1),
          (this[t + i] = (((e / a) >> 0) - s) & 255)
      return t + n
    }),
    (yf.prototype.writeInt8 = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 1, 127, -128),
        yf.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
        e < 0 && (e = 255 + e + 1),
        (this[t] = 255 & e),
        t + 1
      )
    }),
    (yf.prototype.writeInt16LE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 2, 32767, -32768),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
          : jf(this, e, t, !0),
        t + 2
      )
    }),
    (yf.prototype.writeInt16BE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 2, 32767, -32768),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
          : jf(this, e, t, !1),
        t + 2
      )
    }),
    (yf.prototype.writeInt32LE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 4, 2147483647, -2147483648),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = 255 & e),
            (this[t + 1] = e >>> 8),
            (this[t + 2] = e >>> 16),
            (this[t + 3] = e >>> 24))
          : Yf(this, e, t, !0),
        t + 4
      )
    }),
    (yf.prototype.writeInt32BE = function(e, t, n) {
      return (
        (e = +e),
        (t |= 0),
        n || Hf(this, e, t, 4, 2147483647, -2147483648),
        e < 0 && (e = 4294967295 + e + 1),
        yf.TYPED_ARRAY_SUPPORT
          ? ((this[t] = e >>> 24),
            (this[t + 1] = e >>> 16),
            (this[t + 2] = e >>> 8),
            (this[t + 3] = 255 & e))
          : Yf(this, e, t, !1),
        t + 4
      )
    }),
    (yf.prototype.writeFloatLE = function(e, t, n) {
      return Wf(this, e, t, !0, n)
    }),
    (yf.prototype.writeFloatBE = function(e, t, n) {
      return Wf(this, e, t, !1, n)
    }),
    (yf.prototype.writeDoubleLE = function(e, t, n) {
      return zf(this, e, t, !0, n)
    }),
    (yf.prototype.writeDoubleBE = function(e, t, n) {
      return zf(this, e, t, !1, n)
    }),
    (yf.prototype.copy = function(e, t, n, r) {
      if (
        (n || (n = 0),
        r || 0 === r || (r = this.length),
        t >= e.length && (t = e.length),
        t || (t = 0),
        r > 0 && r < n && (r = n),
        r === n)
      )
        return 0
      if (0 === e.length || 0 === this.length) return 0
      if (t < 0) throw new RangeError('targetStart out of bounds')
      if (n < 0 || n >= this.length) throw new RangeError('sourceStart out of bounds')
      if (r < 0) throw new RangeError('sourceEnd out of bounds')
      r > this.length && (r = this.length), e.length - t < r - n && (r = e.length - t + n)
      var o,
        i = r - n
      if (this === e && n < t && t < r) for (o = i - 1; o >= 0; --o) e[o + t] = this[o + n]
      else if (i < 1e3 || !yf.TYPED_ARRAY_SUPPORT) for (o = 0; o < i; ++o) e[o + t] = this[o + n]
      else Uint8Array.prototype.set.call(e, this.subarray(n, n + i), t)
      return i
    }),
    (yf.prototype.fill = function(e, t, n, r) {
      if ('string' == typeof e) {
        if (
          ('string' == typeof t
            ? ((r = t), (t = 0), (n = this.length))
            : 'string' == typeof n && ((r = n), (n = this.length)),
          1 === e.length)
        ) {
          var o = e.charCodeAt(0)
          o < 256 && (e = o)
        }
        if (void 0 !== r && 'string' != typeof r) throw new TypeError('encoding must be a string')
        if ('string' == typeof r && !yf.isEncoding(r)) throw new TypeError('Unknown encoding: ' + r)
      } else 'number' == typeof e && (e &= 255)
      if (t < 0 || this.length < t || this.length < n) throw new RangeError('Out of range index')
      if (n <= t) return this
      var i
      if (
        ((t >>>= 0), (n = void 0 === n ? this.length : n >>> 0), e || (e = 0), 'number' == typeof e)
      )
        for (i = t; i < n; ++i) this[i] = e
      else {
        var a = Tf(e) ? e : Qf(new yf(e, r).toString()),
          s = a.length
        for (i = 0; i < n - t; ++i) this[i + t] = a[i % s]
      }
      return this
    })
  var Xf = /[^+\/0-9A-Za-z-_]/g
  function Jf(e) {
    return e < 16 ? '0' + e.toString(16) : e.toString(16)
  }
  function Qf(e, t) {
    var n
    t = t || Infinity
    for (var r = e.length, o = null, i = [], a = 0; a < r; ++a) {
      if ((n = e.charCodeAt(a)) > 55295 && n < 57344) {
        if (!o) {
          if (n > 56319) {
            ;(t -= 3) > -1 && i.push(239, 191, 189)
            continue
          }
          if (a + 1 === r) {
            ;(t -= 3) > -1 && i.push(239, 191, 189)
            continue
          }
          o = n
          continue
        }
        if (n < 56320) {
          ;(t -= 3) > -1 && i.push(239, 191, 189), (o = n)
          continue
        }
        n = 65536 + (((o - 55296) << 10) | (n - 56320))
      } else o && (t -= 3) > -1 && i.push(239, 191, 189)
      if (((o = null), n < 128)) {
        if ((t -= 1) < 0) break
        i.push(n)
      } else if (n < 2048) {
        if ((t -= 2) < 0) break
        i.push((n >> 6) | 192, (63 & n) | 128)
      } else if (n < 65536) {
        if ((t -= 3) < 0) break
        i.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128)
      } else {
        if (!(n < 1114112)) throw new Error('Invalid code point')
        if ((t -= 4) < 0) break
        i.push((n >> 18) | 240, ((n >> 12) & 63) | 128, ((n >> 6) & 63) | 128, (63 & n) | 128)
      }
    }
    return i
  }
  function Zf(e) {
    return (function(e) {
      var t, n, r, o, i, a
      uf || cf()
      var s = e.length
      if (s % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
      ;(i = '=' === e[s - 2] ? 2 : '=' === e[s - 1] ? 1 : 0),
        (a = new sf((3 * s) / 4 - i)),
        (r = i > 0 ? s - 4 : s)
      var u = 0
      for (t = 0, n = 0; t < r; t += 4, n += 3)
        (o =
          (af[e.charCodeAt(t)] << 18) |
          (af[e.charCodeAt(t + 1)] << 12) |
          (af[e.charCodeAt(t + 2)] << 6) |
          af[e.charCodeAt(t + 3)]),
          (a[u++] = (o >> 16) & 255),
          (a[u++] = (o >> 8) & 255),
          (a[u++] = 255 & o)
      return (
        2 === i
          ? ((o = (af[e.charCodeAt(t)] << 2) | (af[e.charCodeAt(t + 1)] >> 4)), (a[u++] = 255 & o))
          : 1 === i &&
            ((o =
              (af[e.charCodeAt(t)] << 10) |
              (af[e.charCodeAt(t + 1)] << 4) |
              (af[e.charCodeAt(t + 2)] >> 2)),
            (a[u++] = (o >> 8) & 255),
            (a[u++] = 255 & o)),
        a
      )
    })(
      (function(e) {
        if (
          (e = (function(e) {
            return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
          })(e).replace(Xf, '')).length < 2
        )
          return ''
        for (; e.length % 4 != 0; ) e += '='
        return e
      })(e)
    )
  }
  function eg(e, t, n, r) {
    for (var o = 0; o < r && !(o + n >= t.length || o >= e.length); ++o) t[o + n] = e[o]
    return o
  }
  function tg(e) {
    return (
      !!e.constructor && 'function' == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
    )
  }
  var ng = (function(e) {
      function t() {
        var e
        return (
          In(this, t),
          ((e = Gn(this, Nn(t).call(this))).retry = 2),
          (e._request = e.promisify(wx.request)),
          e
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'request',
            value: function(e) {
              return (
                this._checkOptions(e),
                this._initOptions(e),
                (e = An({}, e, { responseType: 'text' })),
                this._requestWithRetry(e)
              )
            }
          },
          {
            key: '_requestWithRetry',
            value: function(e) {
              var t = this,
                n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0
              return this._request(e)
                .then(this._handleResolve)
                .catch(function(r) {
                  if (Fs(r.errMsg)) {
                    if (r.errMsg.includes('abort')) return Vp({})
                    if (r.errMsg.includes('timeout'))
                      return t.retry > 0 && n < t.retry
                        ? t._requestWithRetry(e, ++n)
                        : Kp(new np({ code: rp.NETWORK_TIMEOUT, message: r.errMsg }))
                    if (r.errMsg.includes('fail'))
                      return t.retry > 0 && n < t.retry
                        ? t._requestWithRetry(e, ++n)
                        : Kp(new np({ code: rp.NETWORK_ERROR, message: r.errMsg }))
                  }
                  return Kp(new np(An({ code: rp.UNCAUGHT_ERROR, message: r.message }, r)))
                })
            }
          },
          {
            key: '_handleResolve',
            value: function(e) {
              var t = e.data,
                n = t.error_code,
                r = t.ErrorCode
              return (
                'number' == typeof n && (r = n),
                r !== yu.REQUEST.SUCCESS && (e.data.ErrorCode = Number(''.concat(r))),
                e
              )
            }
          },
          {
            key: 'promisify',
            value: function(e) {
              return function(t) {
                return new Promise(function(n, r) {
                  var o = e(Object.assign({}, t, { success: n, fail: r }))
                  t.updateAbort &&
                    t.updateAbort(function() {
                      o && js(o.abort) && o.abort()
                    })
                })
              }
            }
          }
        ]),
        t
      )
    })(nf),
    rg = (function() {
      function e() {
        In(this, e),
          (this.request = 0),
          (this.success = 0),
          (this.fail = 0),
          (this.reportRate = 10),
          (this.requestTimeCost = [])
      }
      return (
        Tn(e, [
          {
            key: 'report',
            value: function() {
              if (1 !== this.request) {
                if (this.request % this.reportRate != 0) return null
                var e = this.avgRequestTime(),
                  t = 'runLoop reports: success='
                    .concat(this.success, ',fail=')
                    .concat(this.fail, ',total=')
                    .concat(this.request, ',avg=')
                    .concat(e, ',cur=')
                    .concat(this.requestTimeCost[this.requestTimeCost.length - 1], ',max=')
                    .concat(Math.max.apply(null, this.requestTimeCost), ',min=')
                    .concat(Math.min.apply(null, this.requestTimeCost))
                Gs.log(t)
              }
            }
          },
          {
            key: 'setRequestTime',
            value: function(e, t) {
              var n = Math.abs(t - e)
              100 === this.requestTimeCost.length && this.requestTimeCost.shift(),
                this.requestTimeCost.push(n)
            }
          },
          {
            key: 'avgRequestTime',
            value: function() {
              for (var e, t = this.requestTimeCost.length, n = 0, r = 0; r < t; r++)
                n += this.requestTimeCost[r]
              return (e = n / t), Math.round(100 * e) / 100
            }
          }
        ]),
        e
      )
    })(),
    og = ef.CancelToken,
    ig = (function() {
      function e(t) {
        In(this, e), this._initializeOptions(t), this._initializeMembers(), (this.status = new rg())
      }
      return (
        Tn(e, [
          {
            key: 'destructor',
            value: function() {
              clearTimeout(this._seedID)
              var e = this._index()
              for (var t in this) Object.prototype.hasOwnProperty.call(this, t) && (this[t] = null)
              return e
            }
          },
          {
            key: 'setIndex',
            value: function(e) {
              this._index = e
            }
          },
          {
            key: 'getIndex',
            value: function() {
              return this._index
            }
          },
          {
            key: 'isRunning',
            value: function() {
              return !this._stoped
            }
          },
          {
            key: '_initializeOptions',
            value: function(e) {
              this.options = e
            }
          },
          {
            key: '_initializeMembers',
            value: function() {
              ;(this._index = -1),
                (this._seedID = 0),
                (this._requestStatus = !1),
                (this._stoped = !1),
                (this._intervalTime = 0),
                (this._intervalIncreaseStep = 1e3),
                (this._intervalDecreaseStep = 1e3),
                (this._intervalTimeMax = 5e3),
                (this._protectTimeout = 3e3),
                (this._getNoticeSeq = this.options.getNoticeSeq),
                (this._retryCount = 0),
                (this._responseTime = Date.now()),
                (this._responseTimeThreshold = 2e3),
                (this.requestor = tf),
                (this.abort = null)
            }
          },
          {
            key: 'start',
            value: function() {
              0 === this._seedID
                ? ((this._stoped = !1), this._send())
                : Gs.log(
                    'XHRRunLoop.start(), XHRRunLoop is running now, if you want to restart runLoop , please run "stop()" first.'
                  )
            }
          },
          {
            key: '_reset',
            value: function() {
              Gs.log('XHRRunLoop._reset(), reset long poll _intervalTime', this._intervalTime),
                this.stop(),
                this.start()
            }
          },
          {
            key: '_intervalTimeIncrease',
            value: function() {
              this._intervalTime !== this._responseTimeThreshold &&
                (this._intervalTime < this._responseTimeThreshold &&
                  (this._intervalTime += this._intervalIncreaseStep),
                this._intervalTime > this._responseTimeThreshold &&
                  (this._intervalTime = this._responseTimeThreshold))
            }
          },
          {
            key: '_intervalTimeDecrease',
            value: function() {
              0 !== this._intervalTime &&
                (this._intervalTime > 0 && (this._intervalTime -= this._intervalDecreaseStep),
                this._intervalTime < 0 && (this._intervalTime = 0))
            }
          },
          {
            key: '_intervalTimeAdjustment',
            value: function() {
              var e = Date.now()
              100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold
                ? this._intervalTimeIncrease()
                : this._intervalTimeDecrease(),
                (this._responseTime = e)
            }
          },
          {
            key: '_intervalTimeAdjustmentBaseOnResponseData',
            value: function(e) {
              e.ErrorCode === yu.REQUEST.SUCCESS
                ? this._intervalTimeDecrease()
                : this._intervalTimeIncrease()
            }
          },
          {
            key: '_send',
            value: function() {
              var e = this
              if (!0 !== this._requestStatus) {
                ;(this._requestStatus = !0),
                  this.status.request++,
                  'function' == typeof this.options.before &&
                    this.options.before(this.options.pack.requestData)
                var t = Date.now(),
                  n = 0
                this.requestor
                  .request({
                    url: this.options.pack.getUrl(),
                    data: this.options.pack.requestData,
                    method: this.options.pack.method,
                    cancelToken: new og(function(t) {
                      e.abort = t
                    })
                  })
                  .then(function(r) {
                    if (
                      (e._intervalTimeAdjustmentBaseOnResponseData.bind(e)(r.data),
                      e._retryCount > 0 && (e._retryCount = 0),
                      e.status.success++,
                      (n = Date.now()),
                      e.status.setRequestTime(t, n),
                      (r.data.timecost = n - t),
                      'function' == typeof e.options.success)
                    )
                      try {
                        e.options.success({
                          pack: e.options.pack,
                          error: !1,
                          data: e.options.pack.callback(r.data)
                        })
                      } catch (o) {
                        Gs.warn('XHRRunLoop._send(), error:', o)
                      }
                    ;(e._requestStatus = !1),
                      !1 === e._stoped &&
                        (e._seedID = setTimeout(e._send.bind(e), e._intervalTime)),
                      e.status.report()
                  })
                  .catch(function(r) {
                    if (
                      (e.status.fail++,
                      e._retryCount++,
                      e._intervalTimeAdjustment.bind(e)(),
                      !1 === e._stoped &&
                        (e._seedID = setTimeout(e._send.bind(e), e._intervalTime)),
                      (e._requestStatus = !1),
                      'function' == typeof e.options.fail && void 0 !== r.request)
                    )
                      try {
                        e.options.fail({ pack: e.options.pack, error: r, data: !1 })
                      } catch (o) {
                        Gs.warn('XHRRunLoop._send(), fail callback error:'), Gs.error(o)
                      }
                    ;(n = Date.now()), e.status.setRequestTime(t, n), e.status.report()
                  })
              }
            }
          },
          {
            key: 'stop',
            value: function() {
              this._clearAllTimeOut(), (this._stoped = !0)
            }
          },
          {
            key: '_clearAllTimeOut',
            value: function() {
              clearTimeout(this._seedID), (this._seedID = 0)
            }
          }
        ]),
        e
      )
    })(),
    ag = (function() {
      function e(t) {
        In(this, e), this._initializeOptions(t), this._initializeMembers(), (this.status = new rg())
      }
      return (
        Tn(e, [
          {
            key: 'destructor',
            value: function() {
              clearTimeout(this._seedID)
              var e = this._index()
              for (var t in this) Object.prototype.hasOwnProperty.call(this, t) && (this[t] = null)
              return e
            }
          },
          {
            key: 'setIndex',
            value: function(e) {
              this._index = e
            }
          },
          {
            key: 'isRunning',
            value: function() {
              return !this._stoped
            }
          },
          {
            key: 'getIndex',
            value: function() {
              return this._index
            }
          },
          {
            key: '_initializeOptions',
            value: function(e) {
              this.options = e
            }
          },
          {
            key: '_initializeMembers',
            value: function() {
              ;(this._index = -1),
                (this._seedID = 0),
                (this._requestStatus = !1),
                (this._stoped = !1),
                (this._intervalTime = 0),
                (this._intervalIncreaseStep = 1e3),
                (this._intervalDecreaseStep = 1e3),
                (this._intervalTimeMax = 5e3),
                (this._protectTimeout = 3e3),
                (this._getNoticeSeq = this.options.getNoticeSeq),
                (this._retryCount = 0),
                (this._responseTime = Date.now()),
                (this._responseTimeThreshold = 2e3),
                (this.requestor = new ng()),
                (this.abort = null)
            }
          },
          {
            key: 'start',
            value: function() {
              0 === this._seedID
                ? ((this._stoped = !1), this._send())
                : Gs.log(
                    'WXRunLoop.start(): WXRunLoop is running now, if you want to restart runLoop , please run "stop()" first.'
                  )
            }
          },
          {
            key: '_reset',
            value: function() {
              Gs.log('WXRunLoop.reset(), long poll _intervalMaxRate', this._intervalMaxRate),
                this.stop(),
                this.start()
            }
          },
          {
            key: '_intervalTimeIncrease',
            value: function() {
              this._intervalTime !== this._responseTimeThreshold &&
                (this._intervalTime < this._responseTimeThreshold &&
                  (this._intervalTime += this._intervalIncreaseStep),
                this._intervalTime > this._responseTimeThreshold &&
                  (this._intervalTime = this._responseTimeThreshold))
            }
          },
          {
            key: '_intervalTimeDecrease',
            value: function() {
              0 !== this._intervalTime &&
                (this._intervalTime > 0 && (this._intervalTime -= this._intervalDecreaseStep),
                this._intervalTime < 0 && (this._intervalTime = 0))
            }
          },
          {
            key: '_intervalTimeAdjustment',
            value: function() {
              var e = Date.now()
              100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold
                ? this._intervalTimeIncrease()
                : this._intervalTimeDecrease(),
                (this._responseTime = e)
            }
          },
          {
            key: '_intervalTimeAdjustmentBaseOnResponseData',
            value: function(e) {
              e.ErrorCode === yu.REQUEST.SUCCESS
                ? this._intervalTimeDecrease()
                : this._intervalTimeIncrease()
            }
          },
          {
            key: '_send',
            value: function() {
              var e = this
              if (!0 !== this._requestStatus) {
                var t = this
                ;(this._requestStatus = !0),
                  this.status.request++,
                  'function' == typeof this.options.before &&
                    this.options.before(t.options.pack.requestData)
                var n = Date.now(),
                  r = 0
                this.requestor
                  .request({
                    url: t.options.pack.getUrl(),
                    data: t.options.pack.requestData,
                    method: t.options.pack.method,
                    updateAbort: function(t) {
                      e.abort = t
                    }
                  })
                  .then(function(o) {
                    if (
                      (t._intervalTimeAdjustmentBaseOnResponseData.bind(e)(o.data),
                      t._retryCount > 0 && (t._retryCount = 0),
                      e.status.success++,
                      (r = Date.now()),
                      e.status.setRequestTime(n, r),
                      (o.data.timecost = r - n),
                      'function' == typeof t.options.success)
                    )
                      try {
                        e.options.success({
                          pack: e.options.pack,
                          error: !1,
                          data: e.options.pack.callback(o.data)
                        })
                      } catch (i) {
                        Gs.warn('WXRunLoop._send(), error:', i)
                      }
                    ;(t._requestStatus = !1),
                      !1 === t._stoped &&
                        (t._seedID = setTimeout(t._send.bind(t), t._intervalTime)),
                      e.status.report()
                  })
                  .catch(function(o) {
                    if (
                      (e.status.fail++,
                      t._retryCount++,
                      t._intervalTimeAdjustment.bind(e)(),
                      !1 === t._stoped &&
                        (t._seedID = setTimeout(t._send.bind(t), t._intervalTime)),
                      (t._requestStatus = !1),
                      'function' == typeof t.options.fail)
                    )
                      try {
                        e.options.fail({ pack: e.options.pack, error: o, data: !1 })
                      } catch (i) {
                        Gs.warn('WXRunLoop._send(), fail callback error:'), Gs.error(i)
                      }
                    ;(r = Date.now()), e.status.setRequestTime(n, r), e.status.report()
                  })
              }
            }
          },
          {
            key: 'stop',
            value: function() {
              this._clearAllTimeOut(), (this._stoped = !0)
            }
          },
          {
            key: '_clearAllTimeOut',
            value: function() {
              clearTimeout(this._seedID), (this._seedID = 0)
            }
          }
        ]),
        e
      )
    })(),
    sg = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).context = e.context),
          (n.httpConnection = n._getHttpconnection()),
          (n.keepAliveConnections = []),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'initializeListener',
            value: function() {
              this.tim.innerEmitter.on(Sp.SIGN_LOGOUT_EXECUTING, this._stopAllRunLoop, this)
            }
          },
          {
            key: 'request',
            value: function(e) {
              var t = { url: e.url, data: e.requestData, method: e.method, callback: e.callback }
              return this.httpConnection.request(t).then(function(t) {
                return (
                  (t.data = e.callback(t.data)),
                  t.data.errorCode !== yu.REQUEST.SUCCESS
                    ? Kp(new np({ code: t.data.errorCode, message: t.data.errorInfo }))
                    : t
                )
              })
            }
          },
          {
            key: 'createRunLoop',
            value: function(e) {
              var t = this.createKeepAliveConnection(e)
              return t.setIndex(this.keepAliveConnections.push(t) - 1), t
            }
          },
          {
            key: 'stopRunLoop',
            value: function(e) {
              e.stop()
            }
          },
          {
            key: '_stopAllRunLoop',
            value: function() {
              for (var e = this.keepAliveConnections.length, t = 0; t < e; t++)
                this.keepAliveConnections[t].stop()
            }
          },
          {
            key: 'destroyRunLoop',
            value: function(e) {
              e.stop()
              var t = e.destructor()
              this.keepAliveConnections.slice(t, 1)
            }
          },
          {
            key: 'startRunLoopExclusive',
            value: function(e) {
              for (var t = e.getIndex(), n = 0; n < this.keepAliveConnections.length; n++)
                n !== t && this.keepAliveConnections[n].stop()
              e.start()
            }
          },
          {
            key: '_getHttpconnection',
            value: function() {
              return es ? new ng() : new rf()
            }
          },
          {
            key: 'createKeepAliveConnection',
            value: function(e) {
              return es
                ? new ag(e)
                : this.tim.options.runLoopNetType === bl
                ? new ig(e)
                : (this.tim.options.runLoopNetType, new ig(e))
            }
          },
          {
            key: 'clearAll',
            value: function() {
              this.conn.cancelAll()
            }
          },
          {
            key: 'reset',
            value: function() {
              this.keepAliveConnections = []
            }
          }
        ]),
        t
      )
    })(wp),
    ug = (function() {
      function e(t) {
        In(this, e),
          (this.tim = t),
          this.tim.innerEmitter.on(Sp.ERROR_DETECTED, this._onErrorDetected, this)
      }
      return (
        Tn(e, [
          {
            key: '_onErrorDetected',
            value: function(e) {
              e.code
                ? Gs.warn('Oops! code:'.concat(e.code, ' message:').concat(e.message))
                : Gs.warn('Oops! message:'.concat(e.message, ' stack:').concat(e.stack)),
                this.tim.outerEmitter.emit(on.ERROR, e)
            }
          }
        ]),
        e
      )
    })(),
    cg = (function() {
      function e(t) {
        var n = this
        In(this, e),
          gu(t) ||
            ((this.userID = t.userID || ''),
            (this.nick = t.nick || ''),
            (this.gender = t.gender || ''),
            (this.birthday = t.birthday || 0),
            (this.location = t.location || ''),
            (this.selfSignature = t.selfSignature || ''),
            (this.allowType = t.allowType || an.ALLOW_TYPE_ALLOW_ANY),
            (this.language = t.language || 0),
            (this.avatar = t.avatar || ''),
            (this.messageSettings = t.messageSettings || 0),
            (this.adminForbidType = t.adminForbidType || an.FORBID_TYPE_NONE),
            (this.level = t.level || 0),
            (this.role = t.role || 0),
            (this.lastUpdatedTime = 0),
            (this.profileCustomField = []),
            gu(t.profileCustomField) ||
              t.profileCustomField.forEach(function(e) {
                n.profileCustomField.push({ key: e.key, value: e.value })
              }))
      }
      return (
        Tn(e, [
          {
            key: 'validate',
            value: function(e) {
              var t = !0,
                n = ''
              if (gu(e)) return { valid: !1, tips: 'empty options' }
              if (e.profileCustomField)
                for (var r = e.profileCustomField.length, o = null, i = 0; i < r; i++) {
                  if (
                    ((o = e.profileCustomField[i]),
                    !Fs(o.key) || -1 === o.key.indexOf('Tag_Profile_Custom'))
                  )
                    return { valid: !1, tips: '自定义资料字段的前缀必须是 Tag_Profile_Custom' }
                  if (!Fs(o.value))
                    return { valid: !1, tips: '自定义资料字段的 value 必须是字符串' }
                }
              for (var a in e)
                if (Object.prototype.hasOwnProperty.call(e, a)) {
                  if ('profileCustomField' === a) continue
                  if (gu(e[a]) && !Fs(e[a]) && !xs(e[a])) {
                    ;(n = 'key:' + a + ', invalid value:' + e[a]), (t = !1)
                    continue
                  }
                  switch (a) {
                    case 'nick':
                      Fs(e[a]) || ((n = 'nick should be a string'), (t = !1)),
                        eu(e[a]) > 500 &&
                          ((n = 'nick name limited: must less than or equal to '
                            .concat(500, ' bytes, current size: ')
                            .concat(eu(e[a]), ' bytes')),
                          (t = !1))
                      break
                    case 'gender':
                      ou(ql, e.gender) || ((n = 'key:gender, invalid value:' + e.gender), (t = !1))
                      break
                    case 'birthday':
                      xs(e.birthday) || ((n = 'birthday should be a number'), (t = !1))
                      break
                    case 'location':
                      Fs(e.location) || ((n = 'location should be a string'), (t = !1))
                      break
                    case 'selfSignature':
                      Fs(e.selfSignature) || ((n = 'selfSignature should be a string'), (t = !1))
                      break
                    case 'allowType':
                      ou(Kl, e.allowType) ||
                        ((n = 'key:allowType, invalid value:' + e.allowType), (t = !1))
                      break
                    case 'language':
                      xs(e.language) || ((n = 'language should be a number'), (t = !1))
                      break
                    case 'avatar':
                      Fs(e.avatar) || ((n = 'avatar should be a string'), (t = !1))
                      break
                    case 'messageSettings':
                      0 !== e.messageSettings &&
                        1 !== e.messageSettings &&
                        ((n = 'messageSettings should be 0 or 1'), (t = !1))
                      break
                    case 'adminForbidType':
                      ou(Vl, e.adminForbidType) ||
                        ((n = 'key:adminForbidType, invalid value:' + e.adminForbidType), (t = !1))
                      break
                    case 'level':
                      xs(e.level) || ((n = 'level should be a number'), (t = !1))
                      break
                    case 'role':
                      xs(e.role) || ((n = 'role should be a number'), (t = !1))
                      break
                    default:
                      ;(n = 'unknown key:' + a + '  ' + e[a]), (t = !1)
                  }
                }
              return { valid: t, tips: n }
            }
          }
        ]),
        e
      )
    })(),
    lg = (function() {
      function e(t) {
        In(this, e),
          (this.uc = t),
          (this.TAG = 'profile'),
          (this.Actions = { Q: 'query', U: 'update' }),
          (this.accountProfileMap = new Map()),
          (this.expirationTime = 864e5)
      }
      return (
        Tn(e, [
          {
            key: 'setExpirationTime',
            value: function(e) {
              this.expirationTime = e
            }
          },
          {
            key: 'getUserProfile',
            value: function(e) {
              var t = this,
                n = this.uc.tim.connectionController,
                r = e.userIDList
              ;(e.fromAccount = this.uc.getMyAccount()),
                r.length > 100 &&
                  (Gs.warn('ProfileHandler.getUserProfile 获取用户资料人数不能超过100人'),
                  (r.length = 100))
              for (var o, i = [], a = [], s = 0, u = r.length; s < u; s++)
                (o = r[s]),
                  this.uc.isMyFriend(o) && this._containsAccount(o)
                    ? a.push(this._getProfileFromMap(o))
                    : i.push(o)
              if (0 === i.length) return Vp(a)
              e.toAccount = i
              var c = e.bFromGetMyProfile || !1,
                l = []
              e.toAccount.forEach(function(e) {
                l.push({ toAccount: e, standardSequence: 0, customSequence: 0 })
              }),
                (e.userItem = l)
              var p = new Hp()
              p.setMethod(jp.GET_USER_PROFILE).setStart()
              var h = this.uc.makeCapsule(this.TAG, this.Actions.Q, e)
              return n
                .request(h)
                .then(function(e) {
                  p
                    .setCode(0)
                    .setNetworkType(t.uc.getNetworkType())
                    .setText(e.data.userProfileItem.length)
                    .setEnd(),
                    Gs.info('ProfileHandler.getUserProfile ok')
                  var n = t._handleResponse(e).concat(a)
                  return c ? (t.uc.onGotMyProfile(), new xp(n[0])) : new xp(n)
                })
                .catch(function(e) {
                  return (
                    t.uc.probeNetwork().then(function(t, n) {
                      p.setError(e, t, n).setEnd()
                    }),
                    Gs.error('ProfileHandler.getUserProfile error:', e),
                    Kp(e)
                  )
                })
            }
          },
          {
            key: 'getMyProfile',
            value: function() {
              var e = this.uc.getMyAccount()
              if (
                (Gs.log('ProfileHandler.getMyProfile myAccount=' + e),
                this._fillMap(),
                this._containsAccount(e))
              ) {
                var t = this._getProfileFromMap(e)
                return (
                  Gs.debug(
                    'ProfileHandler.getMyProfile from cache, myProfile:' + JSON.stringify(t)
                  ),
                  this.uc.onGotMyProfile(),
                  Vp(t)
                )
              }
              return this.getUserProfile({ fromAccount: e, userIDList: [e], bFromGetMyProfile: !0 })
            }
          },
          {
            key: '_handleResponse',
            value: function(e) {
              for (
                var t, n, r = Xs.now(), o = e.data.userProfileItem, i = [], a = 0, s = o.length;
                a < s;
                a++
              )
                '@TLS#NOT_FOUND' !== o[a].to &&
                  '' !== o[a].to &&
                  ((t = o[a].to),
                  (n = this._updateMap(t, this._getLatestProfileFromResponse(t, o[a].profileItem))),
                  i.push(n))
              return Gs.log('ProfileHandler._handleResponse cost ' + (Xs.now() - r) + ' ms'), i
            }
          },
          {
            key: '_getLatestProfileFromResponse',
            value: function(e, t) {
              var n = {}
              if (((n.userID = e), (n.profileCustomField = []), !gu(t)))
                for (var r = 0, o = t.length; r < o; r++)
                  if (t[r].tag.indexOf('Tag_Profile_Custom') > -1)
                    n.profileCustomField.push({ key: t[r].tag, value: t[r].value })
                  else
                    switch (t[r].tag) {
                      case Fl.NICK:
                        n.nick = t[r].value
                        break
                      case Fl.GENDER:
                        n.gender = t[r].value
                        break
                      case Fl.BIRTHDAY:
                        n.birthday = t[r].value
                        break
                      case Fl.LOCATION:
                        n.location = t[r].value
                        break
                      case Fl.SELFSIGNATURE:
                        n.selfSignature = t[r].value
                        break
                      case Fl.ALLOWTYPE:
                        n.allowType = t[r].value
                        break
                      case Fl.LANGUAGE:
                        n.language = t[r].value
                        break
                      case Fl.AVATAR:
                        n.avatar = t[r].value
                        break
                      case Fl.MESSAGESETTINGS:
                        n.messageSettings = t[r].value
                        break
                      case Fl.ADMINFORBIDTYPE:
                        n.adminForbidType = t[r].value
                        break
                      case Fl.LEVEL:
                        n.level = t[r].value
                        break
                      case Fl.ROLE:
                        n.role = t[r].value
                        break
                      default:
                        Gs.warn('ProfileHandler._handleResponse unkown tag->', t[r].tag, t[r].value)
                    }
              return n
            }
          },
          {
            key: 'updateMyProfile',
            value: function(e) {
              var t = this,
                n = this.uc.tim,
                r = n.connectionController,
                o = n.outerEmitter,
                i = new cg().validate(e)
              if (!i.valid)
                return (
                  Gs.error(
                    'ProfileHandler.updateMyProfile info:'.concat(
                      i.tips,
                      '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile'
                    )
                  ),
                  Kp({
                    code: rp.UPDATE_PROFILE_INVALID_PARAM,
                    message: op.UPDATE_PROFILE_INVALID_PARAM
                  })
                )
              var a = []
              for (var s in e)
                Object.prototype.hasOwnProperty.call(e, s) &&
                  ('profileCustomField' === s
                    ? e.profileCustomField.forEach(function(e) {
                        a.push({ tag: e.key, value: e.value })
                      })
                    : a.push({ tag: Fl[s.toUpperCase()], value: e[s] }))
              if (0 === a.length)
                return (
                  Gs.error(
                    'ProfileHandler.updateMyProfile info:'.concat(
                      op.UPDATE_PROFILE_NO_KEY,
                      '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile'
                    )
                  ),
                  Kp({ code: rp.UPDATE_PROFILE_NO_KEY, message: op.UPDATE_PROFILE_NO_KEY })
                )
              var u = this.uc.makeCapsule(this.TAG, this.Actions.U, {
                fromAccount: this.uc.getMyAccount(),
                profileItem: a
              })
              return r
                .request(u)
                .then(function(n) {
                  Gs.info('ProfileHandler.updateMyProfile ok')
                  var r = t._updateMap(t.uc.getMyAccount(), e)
                  return o.emit(on.PROFILE_UPDATED, [r]), Vp(r)
                })
                .catch(function(e) {
                  return Gs.error('ProfileHandler.updateMyProfile error:', e), Kp(e)
                })
            }
          },
          {
            key: 'onProfileModified',
            value: function(e) {
              var t = e.data
              if (!gu(t)) {
                var n,
                  r,
                  o = t.length
                Gs.info('ProfileHandler.onProfileModified length=' + o)
                for (var i = [], a = 0; a < o; a++)
                  (n = t[a].userID),
                    (r = this._updateMap(
                      n,
                      this._getLatestProfileFromResponse(n, t[a].profileList)
                    )),
                    i.push(r)
                var s = this.uc.tim,
                  u = s.innerEmitter,
                  c = s.outerEmitter
                u.emit(Sp.PROFILE_UPDATED, { data: i }), c.emit(on.PROFILE_UPDATED, i)
              }
            }
          },
          {
            key: '_fillMap',
            value: function() {
              if (0 === this.accountProfileMap.size) {
                for (
                  var e = this._getCachedProfiles(), t = Date.now(), n = 0, r = e.length;
                  n < r;
                  n++
                )
                  t - e[n].lastUpdatedTime < this.expirationTime &&
                    this.accountProfileMap.set(e[n].userID, e[n])
                Gs.log(
                  'ProfileHandler._fillMap from chache, map.size=' + this.accountProfileMap.size
                )
              }
            }
          },
          {
            key: '_updateMap',
            value: function(e, t) {
              var n,
                r = Date.now()
              return (
                this._containsAccount(e)
                  ? ((n = this._getProfileFromMap(e)),
                    t.profileCustomField && uu(n.profileCustomField, t.profileCustomField),
                    Js(n, t, ['profileCustomField']),
                    (n.lastUpdatedTime = r))
                  : ((n = new cg(t)),
                    (this.uc.isMyFriend(e) || e === this.uc.getMyAccount()) &&
                      ((n.lastUpdatedTime = r), this.accountProfileMap.set(e, n))),
                this._flushMap(e === this.uc.getMyAccount()),
                n
              )
            }
          },
          {
            key: '_flushMap',
            value: function(e) {
              var t = bn(this.accountProfileMap.values()),
                n = this.uc.tim.storage
              Gs.debug(
                'ProfileHandler._flushMap length='.concat(t.length, ' flushAtOnce=').concat(e)
              ),
                n.setItem(this.TAG, t, e)
            }
          },
          {
            key: '_containsAccount',
            value: function(e) {
              return this.accountProfileMap.has(e)
            }
          },
          {
            key: '_getProfileFromMap',
            value: function(e) {
              return this.accountProfileMap.get(e)
            }
          },
          {
            key: '_getCachedProfiles',
            value: function() {
              var e = this.uc.tim.storage.getItem(this.TAG)
              return gu(e) ? [] : e
            }
          },
          {
            key: 'onConversationsProfileUpdated',
            value: function(e) {
              for (var t, n, r, o = [], i = 0, a = e.length; i < a; i++)
                (n = (t = e[i]).userID),
                  this.uc.isMyFriend(n) &&
                    (this._containsAccount(n)
                      ? ((r = this._getProfileFromMap(n)), Js(r, t) > 0 && o.push(n))
                      : o.push(t.userID))
              0 !== o.length &&
                (Gs.info('ProfileHandler.onConversationsProfileUpdated toAccount:', o),
                this.getUserProfile({ userIDList: o }))
            }
          },
          {
            key: 'reset',
            value: function() {
              this._flushMap(!0), this.accountProfileMap.clear()
            }
          }
        ]),
        e
      )
    })()
  Ne({ target: 'String', proto: !0 }, { repeat: no })
  var pg = (function() {
      function e(t) {
        In(this, e),
          (this.options = t ? t.options : { enablePointer: !0 }),
          (this.pointsList = {}),
          (this.reportText = {}),
          (this.maxNameLen = 0),
          (this.gapChar = '-'),
          (this.log = console.log),
          (this.currentTask = '')
      }
      return (
        Tn(e, [
          {
            key: 'newTask',
            value: function(e) {
              !1 !== this.options.enablePointer &&
                (e || (e = ['task', this._timeFormat()].join('-')),
                (this.pointsList[e] = []),
                (this.currentTask = e),
                console.log('Pointer new Task : '.concat(this.currentTask)))
            }
          },
          {
            key: 'deleteTask',
            value: function(e) {
              !1 !== this.options.enablePointer &&
                (e || (e = this.currentTask),
                (this.pointsList[e].length = 0),
                delete this.pointsList[e])
            }
          },
          {
            key: 'dot',
            value: function() {
              var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',
                t = arguments.length > 1 ? arguments[1] : void 0
              if (!1 !== this.options.enablePointer) {
                t = t || this.currentTask
                var n = +new Date()
                ;(this.maxNameLen = this.maxNameLen < e.length ? e.length : this.maxNameLen),
                  (this.flen = this.maxNameLen + 10),
                  this.pointsList[t].push({ pointerName: e, time: n })
              }
            }
          },
          {
            key: '_analisys',
            value: function(e) {
              if (!1 !== this.options.enablePointer) {
                e = e || this.currentTask
                for (var t = this.pointsList[e], n = t.length, r = [], o = [], i = 0; i < n; i++)
                  0 !== i && ((o = this._analisysTowPoints(t[i - 1], t[i])), r.push(o.join('')))
                return (
                  (o = this._analisysTowPoints(t[0], t[n - 1], !0)), r.push(o.join('')), r.join('')
                )
              }
            }
          },
          {
            key: '_analisysTowPoints',
            value: function(e, t) {
              var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]
              if (!1 !== this.options.enablePointer) {
                var r = this.flen,
                  o = t.time - e.time,
                  i = o.toString(),
                  a = e.pointerName + this.gapChar.repeat(r - e.pointerName.length),
                  s = t.pointerName + this.gapChar.repeat(r - t.pointerName.length),
                  u = this.gapChar.repeat(4 - i.length) + i,
                  c = n ? ['%c', a, s, u, 'ms\n%c'] : [a, s, u, 'ms\n']
                return c
              }
            }
          },
          {
            key: 'report',
            value: function(e) {
              if (!1 !== this.options.enablePointer) {
                e = e || this.currentTask
                var t = this._analisys(e)
                this.pointsList = []
                var n = this._timeFormat(),
                  r = 'Pointer['.concat(e, '(').concat(n, ')]'),
                  o = 4 * this.maxNameLen,
                  i = (o - r.length) / 2
                console.log(['-'.repeat(i), r, '-'.repeat(i)].join('')),
                  console.log('%c' + t, 'color:#66a', 'color:red', 'color:#66a'),
                  console.log('-'.repeat(o))
              }
            }
          },
          {
            key: '_timeFormat',
            value: function() {
              var e = new Date(),
                t = this.zeroFix(e.getMonth() + 1, 2),
                n = this.zeroFix(e.getDate(), 2)
              return ''
                .concat(t, '-')
                .concat(n, ' ')
                .concat(e.getHours(), ':')
                .concat(e.getSeconds(), ':')
                .concat(e.getMinutes(), '~')
                .concat(e.getMilliseconds())
            }
          },
          {
            key: 'zeroFix',
            value: function(e, t) {
              return ('000000000' + e).slice(-t)
            }
          },
          {
            key: 'reportAll',
            value: function() {
              if (!1 !== this.options.enablePointer)
                for (var e in this.pointsList)
                  Object.prototype.hasOwnProperty.call(this.pointsList, e) && this.eport(e)
            }
          }
        ]),
        e
      )
    })(),
    hg = function e(t, n) {
      In(this, e), (this.userID = t)
      var r = {}
      if (((r.userID = t), !gu(n)))
        for (var o = 0, i = n.length; o < i; o++)
          switch (n[o].tag) {
            case Fl.NICK:
              r.nick = n[o].value
              break
            case Fl.GENDER:
              r.gender = n[o].value
              break
            case Fl.BIRTHDAY:
              r.birthday = n[o].value
              break
            case Fl.LOCATION:
              r.location = n[o].value
              break
            case Fl.SELFSIGNATURE:
              r.selfSignature = n[o].value
              break
            case Fl.ALLOWTYPE:
              r.allowType = n[o].value
              break
            case Fl.LANGUAGE:
              r.language = n[o].value
              break
            case Fl.AVATAR:
              r.avatar = n[o].value
              break
            case Fl.MESSAGESETTINGS:
              r.messageSettings = n[o].value
              break
            case Fl.ADMINFORBIDTYPE:
              r.adminForbidType = n[o].value
              break
            case Fl.LEVEL:
              r.level = n[o].value
              break
            case Fl.ROLE:
              r.role = n[o].value
              break
            default:
              Gs.debug('snsProfileItem unkown tag->', n[o].tag)
          }
      this.profile = new cg(r)
    },
    fg = (function() {
      function e(t) {
        In(this, e),
          (this.uc = t),
          (this.TAG = 'friend'),
          (this.Actions = { G: 'get', D: 'delete' }),
          (this.friends = new Map()),
          (this.pointer = new pg())
      }
      return (
        Tn(e, [
          {
            key: 'isMyFriend',
            value: function(e) {
              var t = this.friends.has(e)
              return t || Gs.debug('FriendHandler.isMyFriend ' + e + ' is not my friend'), t
            }
          },
          {
            key: '_transformFriendList',
            value: function(e) {
              if (!gu(e) && !gu(e.infoItem)) {
                Gs.info('FriendHandler._transformFriendList friendNum=' + e.friendNum)
                for (var t, n, r = e.infoItem, o = 0, i = r.length; o < i; o++)
                  (n = r[o].infoAccount),
                    (t = new hg(n, r[o].snsProfileItem)),
                    this.friends.set(n, t)
              }
            }
          },
          {
            key: '_friends2map',
            value: function(e) {
              var t = new Map()
              for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.set(n, e[n])
              return t
            }
          },
          {
            key: 'getFriendList',
            value: function() {
              var e = this,
                t = this.uc.tim.connectionController,
                n = {}
              ;(n.fromAccount = this.uc.getMyAccount()),
                Gs.info('FriendHandler.getFriendList myAccount=' + n.fromAccount)
              var r = this.uc.makeCapsule(this.TAG, this.Actions.G, n)
              return t
                .request(r)
                .then(function(t) {
                  Gs.info('FriendHandler.getFriendList ok'), e._transformFriendList(t.data)
                  var n = bn(e.friends.values())
                  return Vp(n)
                })
                .catch(function(e) {
                  return Gs.error('FriendHandler.getFriendList error:', JSON.stringify(e)), Kp(e)
                })
            }
          },
          {
            key: 'deleteFriend',
            value: function(e) {
              if (!Array.isArray(e.toAccount))
                return (
                  Gs.error('FriendHandler.deleteFriend options.toAccount 必需是数组'),
                  Kp({ code: rp.DEL_FRIEND_INVALID_PARAM, message: op.DEL_FRIEND_INVALID_PARAM })
                )
              e.toAccount.length > 1e3 &&
                (Gs.warn('FriendHandler.deleteFriend 删除好友人数不能超过1000人'),
                (e.toAccount.length = 1e3))
              var t = this.uc.tim.connectionController,
                n = this.uc.makeCapsule(this.TAG, this.Actions.D, e)
              return t
                .request(n)
                .then(function(e) {
                  return Gs.info('FriendHandler.deleteFriend ok'), Vp()
                })
                .catch(function(e) {
                  return Gs.error('FriendHandler.deleteFriend error:', e), Kp(e)
                })
            }
          }
        ]),
        e
      )
    })(),
    gg = function e(t) {
      In(this, e), gu || ((this.userID = t.userID || ''), (this.timeStamp = t.timeStamp || 0))
    },
    dg = (function() {
      function e(t) {
        In(this, e),
          (this.uc = t),
          (this.TAG = 'blacklist'),
          (this.Actions = { G: 'get', C: 'create', D: 'delete' }),
          (this.blacklistMap = new Map()),
          (this.startIndex = 0),
          (this.maxLimited = 100),
          (this.curruentSequence = 0)
      }
      return (
        Tn(e, [
          {
            key: 'getBlacklist',
            value: function() {
              var e = this,
                t = this.uc.tim.connectionController,
                n = {}
              ;(n.fromAccount = this.uc.getMyAccount()),
                (n.maxLimited = this.maxLimited),
                (n.startIndex = 0),
                (n.lastSequence = this.curruentSequence)
              var r = new Hp()
              r.setMethod(jp.GET_BLACKLIST).setStart()
              var o = this.uc.makeCapsule(this.TAG, this.Actions.G, n)
              return t
                .request(o)
                .then(function(t) {
                  var n = gu(t.data.blackListItem) ? 0 : t.data.blackListItem.length
                  return (
                    r
                      .setCode(0)
                      .setNetworkType(e.uc.getNetworkType())
                      .setText(n)
                      .setEnd(),
                    Gs.info('BlacklistHandler.getBlacklist ok'),
                    (e.curruentSequence = t.data.curruentSequence),
                    e._handleResponse(t.data.blackListItem, !0),
                    e._onBlacklistUpdated()
                  )
                })
                .catch(function(t) {
                  return (
                    e.uc.probeNetwork().then(function(e, n) {
                      r.setError(t, e, n).setEnd()
                    }),
                    Gs.error('BlacklistHandler.getBlacklist error:', t),
                    Kp(t)
                  )
                })
            }
          },
          {
            key: 'addBlacklist',
            value: function(e) {
              var t = this
              if (!Ks(e.userIDList))
                return (
                  Gs.error('BlacklistHandler.addBlacklist options.userIDList 必需是数组'),
                  Kp({
                    code: rp.ADD_BLACKLIST_INVALID_PARAM,
                    message: op.ADD_BLACKLIST_INVALID_PARAM
                  })
                )
              var n = this.uc.tim.loginInfo.identifier
              if (1 === e.userIDList.length && e.userIDList[0] === n)
                return (
                  Gs.error('BlacklistHandler.addBlacklist 不能把自己拉黑'),
                  Kp({
                    code: rp.CANNOT_ADD_SELF_TO_BLACKLIST,
                    message: op.CANNOT_ADD_SELF_TO_BLACKLIST
                  })
                )
              e.userIDList.includes(n) &&
                ((e.userIDList = e.userIDList.filter(function(e) {
                  return e !== n
                })),
                Gs.warn('BlacklistHandler.addBlacklist 不能把自己拉黑，已过滤'))
              var r = this.uc.tim.connectionController
              ;(e.fromAccount = this.uc.getMyAccount()), (e.toAccount = e.userIDList)
              var o = this.uc.makeCapsule(this.TAG, this.Actions.C, e)
              return r
                .request(o)
                .then(function(e) {
                  return (
                    Gs.info('BlacklistHandler.addBlacklist ok'),
                    t._handleResponse(e.data.resultItem, !0),
                    t._onBlacklistUpdated()
                  )
                })
                .catch(function(e) {
                  return Gs.error('BlacklistHandler.addBlacklist error:', e), Kp(e)
                })
            }
          },
          {
            key: '_handleResponse',
            value: function(e, t) {
              if (!gu(e))
                for (var n, r, o, i = 0, a = e.length; i < a; i++)
                  (r = e[i].to),
                    (o = e[i].resultCode),
                    (Bs(o) || 0 === o) &&
                      (t
                        ? (((n = this.blacklistMap.has(r)
                            ? this.blacklistMap.get(r)
                            : new gg()).userID = r),
                          !gu(e[i].addBlackTimeStamp) && (n.timeStamp = e[i].addBlackTimeStamp),
                          this.blacklistMap.set(r, n))
                        : this.blacklistMap.has(r) &&
                          ((n = this.blacklistMap.get(r)), this.blacklistMap.delete(r)))
              Gs.log(
                'BlacklistHandler._handleResponse total=' + this.blacklistMap.size + ' bAdd=' + t
              )
            }
          },
          {
            key: 'deleteBlacklist',
            value: function(e) {
              var t = this
              if (!Ks(e.userIDList))
                return (
                  Gs.error('BlacklistHandler.deleteBlacklist options.userIDList 必需是数组'),
                  Kp({
                    code: rp.DEL_BLACKLIST_INVALID_PARAM,
                    message: op.DEL_BLACKLIST_INVALID_PARAM
                  })
                )
              var n = this.uc.tim.connectionController
              ;(e.fromAccount = this.uc.getMyAccount()), (e.toAccount = e.userIDList)
              var r = this.uc.makeCapsule(this.TAG, this.Actions.D, e)
              return n
                .request(r)
                .then(function(e) {
                  return (
                    Gs.info('BlacklistHandler.deleteBlacklist ok'),
                    t._handleResponse(e.data.resultItem, !1),
                    t._onBlacklistUpdated()
                  )
                })
                .catch(function(e) {
                  return Gs.error('BlacklistHandler.deleteBlacklist error:', e), Kp(e)
                })
            }
          },
          {
            key: '_onBlacklistUpdated',
            value: function() {
              var e = this.uc.tim.outerEmitter,
                t = bn(this.blacklistMap.keys())
              return e.emit(on.BLACKLIST_UPDATED, t), Vp(t)
            }
          },
          {
            key: 'handleBlackListDelAccount',
            value: function(e) {
              for (var t, n = [], r = 0, o = e.length; r < o; r++)
                (t = e[r]), this.blacklistMap.has(t) && (this.blacklistMap.delete(t), n.push(t))
              n.length > 0 &&
                (Gs.log(
                  'BlacklistHandler.handleBlackListDelAccount delCount=' +
                    n.length +
                    ' : ' +
                    n.join(',')
                ),
                this.tim.outerEmitter.emit(on.BLACKLIST_UPDATED, bn(this.blacklistMap.keys())))
            }
          },
          {
            key: 'handleBlackListAddAccount',
            value: function(e) {
              for (var t, n = [], r = 0, o = e.length; r < o; r++)
                (t = e[r]),
                  this.blacklistMap.has(t) ||
                    (this.blacklistMap.set(t, new gg({ userID: t })), n.push(t))
              n.length > 0 &&
                (Gs.log(
                  'BlacklistHandler.handleBlackListAddAccount addCount=' +
                    n.length +
                    ' : ' +
                    n.join(',')
                ),
                this.tim.outerEmitter.emit(on.BLACKLIST_UPDATED, bn(this.blacklistMap.keys())))
            }
          },
          {
            key: 'reset',
            value: function() {
              this.blacklistMap.clear(),
                (this.startIndex = 0),
                (this.maxLimited = 100),
                (this.curruentSequence = 0)
            }
          }
        ]),
        e
      )
    })(),
    mg = (function() {
      function e(t) {
        In(this, e),
          (this.uc = t),
          (this.TAG = 'applyC2C'),
          (this.Actions = { C: 'create', G: 'get', D: 'delete', U: 'update' })
      }
      return (
        Tn(e, [
          {
            key: 'applyAddFriend',
            value: function(e) {
              var t = this,
                n = this.uc.tim.connectionController,
                r = this.uc.makeCapsule(this.TAG, this.Actions.C, e),
                o = n.request(r)
              return (
                o
                  .then(function(e) {
                    t.uc.isActionSuccessful('applyAddFriend', t.Actions.C, e)
                  })
                  .catch(function(e) {}),
                o
              )
            }
          },
          {
            key: 'getPendency',
            value: function(e) {
              var t = this,
                n = this.tim.connectionController,
                r = this.uc.makeCapsule(this.TAG, this.Actions.G, e),
                o = n.request(r)
              return (
                o
                  .then(function(e) {
                    t.uc.isActionSuccessful('getPendency', t.Actions.G, e)
                  })
                  .catch(function(e) {}),
                o
              )
            }
          },
          {
            key: 'deletePendency',
            value: function(e) {
              var t = this,
                n = this.tim.connectionController,
                r = this.uc.makeCapsule(this.TAG, this.Actions.D, e),
                o = n.request(r)
              return (
                o
                  .then(function(e) {
                    t.uc.isActionSuccessful('deletePendency', t.Actions.D, e)
                  })
                  .catch(function(e) {}),
                o
              )
            }
          },
          {
            key: 'replyPendency',
            value: function() {
              var e = this,
                t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
                n = this.tim.connectionController,
                r = this.uc.makeCapsule(this.TAG, this.Actions.U, t),
                o = n.request(r)
              return (
                o
                  .then(function(t) {
                    e.uc.isActionSuccessful('replyPendency', e.Actions.U, t)
                  })
                  .catch(function(e) {}),
                o
              )
            }
          }
        ]),
        e
      )
    })(),
    _g = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).profileHandler = new lg(kn(n))),
          (n.friendHandler = new fg(kn(n))),
          (n.blacklistHandler = new dg(kn(n))),
          (n.applyC2CHandler = new mg(kn(n))),
          n._initializeListener(),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initializeListener',
            value: function(e) {
              var t = this.tim.innerEmitter
              t.on(Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED, this.onContextUpdated, this),
                t.on(Sp.NOTICE_LONGPOLL_PROFILE_MODIFIED, this.onProfileModified, this),
                t.on(Sp.NOTICE_LONGPOLL_NEW_FRIEND_MESSAGES, this.onNewFriendMessages, this),
                t.on(Sp.CONVERSATION_LIST_PROFILE_UPDATED, this.onConversationsProfileUpdated, this)
            }
          },
          {
            key: 'onContextUpdated',
            value: function(e) {
              var t = e.data.context
              !1 != !!t.a2Key &&
                !1 != !!t.tinyID &&
                (this.profileHandler.getMyProfile(),
                this.friendHandler.getFriendList(),
                this.blacklistHandler.getBlacklist())
            }
          },
          {
            key: 'onGotMyProfile',
            value: function() {
              this.triggerReady()
            }
          },
          {
            key: 'onProfileModified',
            value: function(e) {
              this.profileHandler.onProfileModified(e)
            }
          },
          {
            key: 'onNewFriendMessages',
            value: function(e) {
              Gs.debug('onNewFriendMessages', JSON.stringify(e.data)),
                gu(e.data.blackListDelAccount) ||
                  this.blacklistHandler.handleBlackListDelAccount(e.data.blackListDelAccount),
                gu(e.data.blackListAddAccount) ||
                  this.blacklistHandler.handleBlackListAddAccount(e.data.blackListAddAccount)
            }
          },
          {
            key: 'onConversationsProfileUpdated',
            value: function(e) {
              this.profileHandler.onConversationsProfileUpdated(e.data)
            }
          },
          {
            key: 'getMyAccount',
            value: function() {
              return this.tim.context.identifier
            }
          },
          {
            key: 'isMyFriend',
            value: function(e) {
              return this.friendHandler.isMyFriend(e)
            }
          },
          {
            key: 'makeCapsule',
            value: function(e, t, n) {
              return this.createPackage({ name: e, action: t, param: n })
            }
          },
          {
            key: 'getMyProfile',
            value: function() {
              return this.profileHandler.getMyProfile()
            }
          },
          {
            key: 'getUserProfile',
            value: function(e) {
              return this.profileHandler.getUserProfile(e)
            }
          },
          {
            key: 'updateMyProfile',
            value: function(e) {
              return this.profileHandler.updateMyProfile(e)
            }
          },
          {
            key: 'getFriendList',
            value: function() {
              return this.friendHandler.getFriendList()
            }
          },
          {
            key: 'deleteFriend',
            value: function(e) {
              return this.friendHandler.deleteFriend(e)
            }
          },
          {
            key: 'getBlacklist',
            value: function() {
              return this.blacklistHandler.getBlacklist()
            }
          },
          {
            key: 'addBlacklist',
            value: function(e) {
              return this.blacklistHandler.addBlacklist(e)
            }
          },
          {
            key: 'deleteBlacklist',
            value: function(e) {
              return this.blacklistHandler.deleteBlacklist(e)
            }
          },
          {
            key: 'applyAddFriend',
            value: function(e) {
              return this.applyC2CHandler.applyAddFriend(e)
            }
          },
          {
            key: 'getPendency',
            value: function(e) {
              return this.applyC2CHandler.getPendency(e)
            }
          },
          {
            key: 'deletePendency',
            value: function(e) {
              return this.applyC2CHandler.deletePendency(e)
            }
          },
          {
            key: 'replyPendency',
            value: function(e) {
              return this.applyC2CHandler.replyPendency(e)
            }
          },
          {
            key: 'reset',
            value: function() {
              Gs.info('UserController.reset'),
                this.resetReady(),
                this.profileHandler.reset(),
                this.blacklistHandler.reset(),
                (this.checkTimes = 0)
            }
          }
        ]),
        t
      )
    })(wp),
    yg = [],
    vg = yg.sort,
    Eg = o(function() {
      yg.sort(void 0)
    }),
    Sg = o(function() {
      yg.sort(null)
    }),
    Ig = je('sort')
  Ne(
    { target: 'Array', proto: !0, forced: Eg || !Sg || Ig },
    {
      sort: function(e) {
        return void 0 === e ? vg.call(Pe(this)) : vg.call(Pe(this), Re(e))
      }
    }
  )
  var Cg = [
      'groupID',
      'name',
      'avatar',
      'type',
      'introduction',
      'notification',
      'ownerID',
      'selfInfo',
      'createTime',
      'infoSequence',
      'lastInfoTime',
      'lastMessage',
      'nextMessageSeq',
      'memberNum',
      'maxMemberNum',
      'memberList',
      'joinOption',
      'groupCustomField'
    ],
    Tg = (function() {
      function e(t) {
        In(this, e),
          (this.groupID = ''),
          (this.name = ''),
          (this.avatar = ''),
          (this.type = ''),
          (this.introduction = ''),
          (this.notification = ''),
          (this.ownerID = ''),
          (this.createTime = ''),
          (this.infoSequence = ''),
          (this.lastInfoTime = ''),
          (this.selfInfo = { messageRemindType: '', joinTime: '', nameCard: '', role: '' }),
          (this.lastMessage = {
            lastTime: '',
            lastSequence: '',
            fromAccount: '',
            messageForShow: ''
          }),
          (this.nextMessageSeq = ''),
          (this.memberNum = ''),
          (this.maxMemberNum = ''),
          (this.joinOption = ''),
          (this.groupCustomField = []),
          this._initGroup(t)
      }
      return (
        Tn(e, [
          {
            key: '_initGroup',
            value: function(e) {
              for (var t in e)
                Cg.indexOf(t) < 0 ||
                  ('selfInfo' !== t ? (this[t] = e[t]) : this.updateSelfInfo(e[t]))
            }
          },
          {
            key: 'updateGroup',
            value: function(e) {
              e.lastMsgTime && (this.lastMessage.lastTime = e.lastMsgTime),
                e.groupCustomField && uu(this.groupCustomField, e.groupCustomField),
                Js(this, e, ['members', 'errorCode', 'lastMsgTime', 'groupCustomField'])
            }
          },
          {
            key: 'updateSelfInfo',
            value: function(e) {
              var t = e.nameCard,
                n = e.joinTime,
                r = e.role,
                o = e.messageRemindType
              Js(
                this.selfInfo,
                { nameCard: t, joinTime: n, role: r, messageRemindType: o },
                [],
                ['', null, void 0, 0, NaN]
              )
            }
          },
          {
            key: 'setSelfNameCard',
            value: function(e) {
              this.selfInfo.nameCard = e
            }
          }
        ]),
        e
      )
    })(),
    Mg = function(e, t) {
      if (Bs(t)) return ''
      switch (e) {
        case an.MSG_TEXT:
          return t.text
        case an.MSG_IMAGE:
          return '[图片]'
        case an.MSG_GEO:
          return '[位置]'
        case an.MSG_AUDIO:
          return '[语音]'
        case an.MSG_VIDEO:
          return '[视频]'
        case an.MSG_FILE:
          return '[文件]'
        case an.MSG_CUSTOM:
          return '[自定义消息]'
        case an.MSG_GRP_TIP:
          return '[群提示消息]'
        case an.MSG_GRP_SYS_NOTICE:
          return '[群系统通知]'
        case an.MSG_FACE:
          return '[动画表情]'
        default:
          return ''
      }
    },
    Og = function(e) {
      return Bs(e)
        ? {
            lastTime: 0,
            lastSequence: 0,
            fromAccount: 0,
            messageForShow: '',
            payload: null,
            type: '',
            isRevoked: !1
          }
        : e instanceof pp
        ? {
            lastTime: e.time || 0,
            lastSequence: e.sequence || 0,
            fromAccount: e.from || '',
            messageForShow: Mg(e.type, e.payload),
            payload: e.payload || null,
            type: e.type || null,
            isRevoked: !1
          }
        : An({}, e, { isRevoked: !1, messageForShow: Mg(e.type, e.payload) })
    },
    Ag = (function() {
      function e(t) {
        In(this, e),
          (this.conversationID = t.conversationID || ''),
          (this.unreadCount = t.unreadCount || 0),
          (this.type = t.type || ''),
          (this.lastMessage = Og(t.lastMessage)),
          (this._isInfoCompleted = !1),
          this._initProfile(t)
      }
      return (
        Tn(e, [
          {
            key: '_initProfile',
            value: function(e) {
              var t = this
              Object.keys(e).forEach(function(n) {
                switch (n) {
                  case 'userProfile':
                    t.userProfile = e.userProfile
                    break
                  case 'groupProfile':
                    t.groupProfile = e.groupProfile
                }
              }),
                Bs(this.userProfile) && this.type === an.CONV_C2C
                  ? (this.userProfile = new cg({ userID: e.conversationID.replace('C2C', '') }))
                  : Bs(this.groupProfile) &&
                    this.type === an.CONV_GROUP &&
                    (this.groupProfile = new Tg({ groupID: e.conversationID.replace('GROUP', '') }))
            }
          },
          {
            key: 'updateUnreadCount',
            value: function(e, t) {
              Bs(e) ||
                (this.subType === an.GRP_CHATROOM || lu(this.subType)
                  ? (this.unreadCount = 0)
                  : t && this.type === an.CONV_GROUP
                  ? (this.unreadCount = e)
                  : (this.unreadCount = this.unreadCount + e))
            }
          },
          {
            key: 'reduceUnreadCount',
            value: function() {
              this.unreadCount >= 1 && (this.unreadCount -= 1)
            }
          },
          {
            key: 'isLastMessageRevoked',
            value: function(e) {
              var t = e.sequence,
                n = e.time
              return (
                (this.type === an.CONV_C2C &&
                  t === this.lastMessage.lastSequence &&
                  n === this.lastMessage.lastTime) ||
                (this.type === an.CONV_GROUP && t === this.lastMessage.lastSequence)
              )
            }
          },
          {
            key: 'setLastMessageRevoked',
            value: function(e) {
              this.lastMessage.isRevoked = e
            }
          },
          {
            key: 'toAccount',
            get: function() {
              return this.conversationID.replace('C2C', '').replace('GROUP', '')
            }
          },
          {
            key: 'subType',
            get: function() {
              return this.groupProfile ? this.groupProfile.type : ''
            }
          }
        ]),
        e
      )
    })(),
    Dg = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).pagingStatus = yu.PAGING_CONVERSATION.NOT_START),
          (n.pagingTimeStamp = 0),
          (n.conversationMap = new Map()),
          (n.tempGroupList = []),
          n._initListeners(),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'hasLocalConversationMap',
            value: function() {
              return this.conversationMap.size > 0
            }
          },
          {
            key: 'createLocalConversation',
            value: function(e) {
              return this.conversationMap.has(e)
                ? this.conversationMap.get(e)
                : new Ag({
                    conversationID: e,
                    type: e.slice(0, 3) === an.CONV_C2C ? an.CONV_C2C : an.CONV_GROUP
                  })
            }
          },
          {
            key: 'hasLocalConversation',
            value: function(e) {
              return this.conversationMap.has(e)
            }
          },
          {
            key: 'getConversationList',
            value: function() {
              var e = this
              Gs.log('ConversationController.getConversationList.'),
                this.pagingStatus === yu.PAGING_CONVERSATION.REJECTED &&
                  (Gs.log(
                    'ConversationController.getConversationList. continue to sync conversationList'
                  ),
                  this._syncConversationList())
              var t = new Hp()
              t.setMethod(jp.GET_CONVERSATION_LIST).setStart()
              var n = this.createPackage({ name: 'conversation', action: 'query' })
              return this.tim.connectionController
                .request(n)
                .then(function(n) {
                  var r = n.data.conversations,
                    o = void 0 === r ? [] : r,
                    i = e._getConversationOptions(o)
                  return (
                    e._updateLocalConversationList(i, !0),
                    e._setStorageConversationList(),
                    t
                      .setCode(0)
                      .setText(o.length)
                      .setEnd(),
                    Gs.log('ConversationController.getConversationList ok.'),
                    Vp({ conversationList: e.getLocalConversationList() })
                  )
                })
                .catch(function(n) {
                  return (
                    e.probeNetwork().then(function(e, r) {
                      t.setError(n, e, r).setEnd()
                    }),
                    Gs.error('ConversationController.getConversationList error:', n),
                    Kp(n)
                  )
                })
            }
          },
          {
            key: '_syncConversationList',
            value: function() {
              var e = this,
                t = new Hp()
              return (
                t.setMethod(jp.SYNC_CONVERSATION_LIST).setStart(),
                this.pagingStatus === yu.PAGING_CONVERSATION.NOT_START &&
                  this.conversationMap.clear(),
                this._autoPagingSyncConversationList()
                  .then(function(n) {
                    return (
                      (e.pagingStatus = yu.PAGING_CONVERSATION.RESOLVED),
                      e._setStorageConversationList(),
                      t
                        .setCode(0)
                        .setText(''.concat(e.conversationMap.size))
                        .setEnd(),
                      n
                    )
                  })
                  .catch(function(n) {
                    return (
                      (e.pagingStatus = yu.PAGING_CONVERSATION.REJECTED),
                      t.setText(e.pagingTimeStamp),
                      e.probeNetwork().then(function(e, r) {
                        t.setError(n, e, r).setEnd()
                      }),
                      Kp(n)
                    )
                  })
              )
            }
          },
          {
            key: '_autoPagingSyncConversationList',
            value: function() {
              var e = this
              this.pagingStatus = yu.PAGING_CONVERSATION.PENDING
              var t = this.createPackage({
                name: 'conversation',
                action: 'pagingQuery',
                param: {
                  fromAccount: this.tim.context.identifier,
                  timeStamp: this.pagingTimeStamp,
                  orderType: 1
                }
              })
              return this.connectionController.request(t).then(function(t) {
                var n = t.data,
                  r = n.completeFlag,
                  o = n.conversations,
                  i = void 0 === o ? [] : o,
                  a = n.timeStamp
                if (i.length > 0) {
                  var s = e._getConversationOptions(i)
                  e._updateLocalConversationList(s, !0)
                }
                return (
                  e._isReady ? e._emitConversationUpdate() : e.triggerReady(),
                  (e.pagingTimeStamp = a),
                  1 !== r ? e._autoPagingSyncConversationList() : Vp()
                )
              })
            }
          },
          {
            key: 'getConversationProfile',
            value: function(e) {
              var t = this.conversationMap.has(e)
                ? this.conversationMap.get(e)
                : this.createLocalConversation(e)
              return t._isInfoCompleted || t.type === an.CONV_SYSTEM
                ? Vp({ conversation: t })
                : (Gs.log('ConversationController.getConversationProfile. conversationID:', e),
                  this._updateUserOrGroupProfileCompletely(t)
                    .then(function(t) {
                      return (
                        Gs.log(
                          'ConversationController.getConversationProfile ok. conversationID:',
                          e
                        ),
                        t
                      )
                    })
                    .catch(function(e) {
                      return (
                        Gs.error('ConversationController.getConversationProfile error:', e), Kp(e)
                      )
                    }))
            }
          },
          {
            key: 'deleteConversation',
            value: function(e) {
              var t = this,
                n = {}
              if (!this.conversationMap.has(e)) {
                var r = new np({
                  code: rp.CONVERSATION_NOT_FOUND,
                  message: op.CONVERSATION_NOT_FOUND
                })
                return Kp(r)
              }
              switch (this.conversationMap.get(e).type) {
                case an.CONV_C2C:
                  ;(n.type = 1), (n.toAccount = e.slice(3))
                  break
                case an.CONV_GROUP:
                  ;(n.type = 2), (n.toGroupID = e.slice(5))
                  break
                case an.CONV_SYSTEM:
                  return (
                    this.tim.groupController.deleteGroupSystemNotice({
                      messageList: this.tim.messageController.getLocalMessageList(e)
                    }),
                    this.deleteLocalConversation(e),
                    Vp({ conversationID: e })
                  )
                default:
                  var o = new np({
                    code: rp.CONVERSATION_UN_RECORDED_TYPE,
                    message: op.CONVERSATION_UN_RECORDED_TYPE
                  })
                  return Kp(o)
              }
              Gs.log('ConversationController.deleteConversation. conversationID:', e)
              var i = this.createPackage({ name: 'conversation', action: 'delete', param: n })
              return this.tim
                .setMessageRead({ conversationID: e })
                .then(function() {
                  return t.connectionController.request(i)
                })
                .then(function() {
                  return (
                    Gs.log('ConversationController.deleteConversation ok. conversationID:', e),
                    t.deleteLocalConversation(e),
                    Vp({ conversationID: e })
                  )
                })
                .catch(function(e) {
                  return Gs.error('ConversationController.deleteConversation error:', e), Kp(e)
                })
            }
          },
          {
            key: 'getLocalConversationList',
            value: function() {
              return bn(this.conversationMap.values())
            }
          },
          {
            key: 'getLocalConversation',
            value: function(e) {
              return this.conversationMap.get(e)
            }
          },
          {
            key: '_initLocalConversationList',
            value: function() {
              var e = new Hp()
              e.setMethod(jp.GET_CONVERSATION_LIST_IN_STORAGE).setStart(),
                Gs.time(Bp.INIT_CONVERSATION_LIST),
                Gs.log('ConversationController._initLocalConversationList init')
              var t = this._getStorageConversationList()
              if (t) {
                for (var n = t.length, r = 0; r < n; r++)
                  this.conversationMap.set(t[r].conversationID, new Ag(t[r]))
                this._emitConversationUpdate(!0, !1),
                  e
                    .setCode(0)
                    .setNetworkType(this.getNetworkType())
                    .setText(n)
                    .setEnd()
              } else
                e.setCode(0)
                  .setNetworkType(this.getNetworkType())
                  .setText(0)
                  .setEnd()
              this._syncConversationList()
            }
          },
          {
            key: '_getStorageConversationList',
            value: function() {
              return this.tim.storage.getItem('conversationMap')
            }
          },
          {
            key: '_setStorageConversationList',
            value: function() {
              var e = this.getLocalConversationList()
                .slice(0, 20)
                .map(function(e) {
                  return {
                    conversationID: e.conversationID,
                    type: e.type,
                    subType: e.subType,
                    lastMessage: e.lastMessage,
                    groupProfile: e.groupProfile,
                    userProfile: e.userProfile
                  }
                })
              this.tim.storage.setItem('conversationMap', e)
            }
          },
          {
            key: '_initListeners',
            value: function() {
              var e = this
              this.tim.innerEmitter.once(
                Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED,
                this._initLocalConversationList,
                this
              ),
                this.tim.innerEmitter.on(Sp.MESSAGE_SENT, this._onSendOrReceiveMessage, this),
                this.tim.innerEmitter.on(
                  Sp.MESSAGE_SYNC_PROCESSING,
                  this._handleSyncMessages,
                  this
                ),
                this.tim.innerEmitter.on(Sp.MESSAGE_SYNC_FINISHED, this._handleSyncMessages, this),
                this.tim.innerEmitter.on(
                  Sp.MESSAGE_C2C_INSTANT_RECEIVED,
                  this._onSendOrReceiveMessage,
                  this
                ),
                this.tim.innerEmitter.on(
                  Sp.MESSAGE_GROUP_INSTANT_RECEIVED,
                  this._onSendOrReceiveMessage,
                  this
                ),
                this.tim.innerEmitter.on(
                  Sp.MESSAGE_GROUP_SYSTEM_NOTICE_RECEIVED,
                  this._onSendOrReceiveMessage,
                  this
                ),
                this.tim.innerEmitter.on(
                  Sp.GROUP_LIST_UPDATED,
                  this._updateConversationGroupProfile,
                  this
                ),
                this.tim.innerEmitter.on(
                  Sp.PROFILE_UPDATED,
                  this._updateConversationUserProfile,
                  this
                ),
                this.tim.innerEmitter.on(Sp.MESSAGE_REVOKED, this._onMessageRevoked, this),
                this.ready(function() {
                  e.tempGroupList.length > 0 &&
                    (e._updateConversationGroupProfile(e.tempGroupList),
                    (e.tempGroupList.length = 0))
                })
            }
          },
          {
            key: '_updateConversationGroupProfile',
            value: function(e) {
              var t = this
              ;(Ks(e) && 0 === e.length) ||
                (this.hasLocalConversationMap()
                  ? (e.forEach(function(e) {
                      var n = 'GROUP'.concat(e.groupID)
                      if (t.conversationMap.has(n)) {
                        var r = t.conversationMap.get(n)
                        ;(r.groupProfile = e),
                          (r.lastMessage.lastSequence = e.nextMessageSeq - 1),
                          r.subType || (r.subType = e.type)
                      }
                    }),
                    this._emitConversationUpdate(!0, !1))
                  : (this.tempGroupList = e))
            }
          },
          {
            key: '_updateConversationUserProfile',
            value: function(e) {
              var t = this
              e.data.forEach(function(e) {
                var n = 'C2C'.concat(e.userID)
                t.conversationMap.has(n) && (t.conversationMap.get(n).userProfile = e)
              }),
                this._emitConversationUpdate(!0, !1)
            }
          },
          {
            key: '_onMessageRevoked',
            value: function(e) {
              var t = this,
                n = e.data
              if (0 !== n.length) {
                var r = null,
                  o = !1
                n.forEach(function(e) {
                  ;(r = t.conversationMap.get(e.conversationID)) &&
                    r.isLastMessageRevoked(e) &&
                    ((o = !0), r.setLastMessageRevoked(!0))
                }),
                  o && this._emitConversationUpdate(!0, !1)
              }
            }
          },
          {
            key: '_handleSyncMessages',
            value: function(e) {
              this._onSendOrReceiveMessage(e, !0)
            }
          },
          {
            key: '_onSendOrReceiveMessage',
            value: function(e) {
              var t = this,
                n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1],
                r = e.data.eventDataList
              this._isReady
                ? 0 !== r.length &&
                  (this._updateLocalConversationList(r, !1, n),
                  this._setStorageConversationList(),
                  this._emitConversationUpdate())
                : this.ready(function() {
                    t._onSendOrReceiveMessage(e, n)
                  })
            }
          },
          {
            key: '_updateLocalConversationList',
            value: function(e, t, n) {
              var r
              ;(r = this._updateTempConversations(e, t, n)),
                (this.conversationMap = new Map(
                  this._sortConversations([].concat(bn(r.conversations), bn(this.conversationMap)))
                )),
                t || this._updateUserOrGroupProfile(r.newerConversations)
            }
          },
          {
            key: '_updateTempConversations',
            value: function(e, t, n) {
              for (var r = [], o = [], i = 0, a = e.length; i < a; i++) {
                var s = new Ag(e[i]),
                  u = this.conversationMap.get(s.conversationID)
                if (this.conversationMap.has(s.conversationID)) {
                  var c = ['unreadCount', 'allowType', 'adminForbidType', 'payload']
                  n && c.push('lastMessage'),
                    Js(u, s, c, [null, void 0, '', 0, NaN]),
                    u.updateUnreadCount(s.unreadCount, t),
                    n || (u.lastMessage.payload = e[i].lastMessage.payload),
                    this.conversationMap.delete(u.conversationID),
                    r.push([u.conversationID, u])
                } else {
                  if (s.type === an.CONV_GROUP) {
                    var l = s.groupProfile.groupID,
                      p = this.tim.groupController.getLocalGroupProfile(l)
                    p && ((s.groupProfile = p), s.updateUnreadCount(0))
                  }
                  o.push(s), r.push([s.conversationID, s])
                }
              }
              return { conversations: r, newerConversations: o }
            }
          },
          {
            key: '_sortConversations',
            value: function(e) {
              return e.sort(function(e, t) {
                return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime
              })
            }
          },
          {
            key: '_updateUserOrGroupProfile',
            value: function(e) {
              var t = this
              if (0 !== e.length) {
                var n = [],
                  r = []
                e.forEach(function(e) {
                  if (e.type === an.CONV_C2C) n.push(e.toAccount)
                  else if (e.type === an.CONV_GROUP) {
                    var o = e.toAccount
                    t.tim.groupController.hasLocalGroup(o)
                      ? (e.groupProfile = t.tim.groupController.getLocalGroupProfile(o))
                      : r.push(o)
                  }
                }),
                  n.length > 0 &&
                    this.tim.getUserProfile({ userIDList: n }).then(function(e) {
                      var n = e.data
                      Ks(n)
                        ? n.forEach(function(e) {
                            t.conversationMap.get('C2C'.concat(e.userID)).userProfile = e
                          })
                        : (t.conversationMap.get('C2C'.concat(n.userID)).userProfile = n)
                    }),
                  r.length > 0 &&
                    this.tim.groupController
                      .getGroupProfileAdvance({
                        groupIDList: r,
                        responseFilter: { groupBaseInfoFilter: ['Type', 'Name', 'FaceUrl'] }
                      })
                      .then(function(e) {
                        e.data.successGroupList.forEach(function(e) {
                          var n = 'GROUP'.concat(e.groupID)
                          if (t.conversationMap.has(n)) {
                            var r = t.conversationMap.get(n)
                            Js(r.groupProfile, e, [], [null, void 0, '', 0, NaN]),
                              !r.subType && e.type && (r.subType = e.type)
                          }
                        })
                      })
              }
            }
          },
          {
            key: '_updateUserOrGroupProfileCompletely',
            value: function(e) {
              var t = this
              return e.type === an.CONV_C2C
                ? this.tim.getUserProfile({ userIDList: [e.toAccount] }).then(function(n) {
                    var r = n.data
                    return 0 === r.length
                      ? Kp(
                          new np({
                            code: rp.USER_OR_GROUP_NOT_FOUND,
                            message: op.USER_OR_GROUP_NOT_FOUND
                          })
                        )
                      : ((e.userProfile = r[0]),
                        (e._isInfoCompleted = !0),
                        t._unshiftConversation(e),
                        Vp({ conversation: e }))
                  })
                : this.tim.getGroupProfile({ groupID: e.toAccount }).then(function(n) {
                    return (
                      (e.groupProfile = n.data.group),
                      (e._isInfoCompleted = !0),
                      t._unshiftConversation(e),
                      Vp({ conversation: e })
                    )
                  })
            }
          },
          {
            key: '_unshiftConversation',
            value: function(e) {
              e instanceof Ag &&
                !this.conversationMap.has(e.conversationID) &&
                ((this.conversationMap = new Map(
                  [[e.conversationID, e]].concat(bn(this.conversationMap))
                )),
                this._setStorageConversationList(),
                this._emitConversationUpdate(!0, !1))
            }
          },
          {
            key: 'deleteLocalConversation',
            value: function(e) {
              return (
                this.conversationMap.delete(e),
                this._setStorageConversationList(),
                this.tim.innerEmitter.emit(Sp.CONVERSATION_DELETED, e),
                this._emitConversationUpdate(!0, !1),
                this.conversationMap.has(e)
              )
            }
          },
          {
            key: '_getConversationOptions',
            value: function(e) {
              var t = [],
                n = e
                  .filter(function(e) {
                    var t = e.lastMsg
                    return Vs(t)
                  })
                  .map(function(e) {
                    if (1 === e.type) {
                      var n = { userID: e.userID, nick: e.c2CNick, avatar: e.c2CImage }
                      return (
                        t.push(n),
                        {
                          conversationID: 'C2C'.concat(e.userID),
                          type: 'C2C',
                          lastMessage: {
                            lastTime: e.time,
                            lastSequence: e.sequence,
                            fromAccount: e.lastC2CMsgFromAccount,
                            messageForShow: e.messageShow,
                            type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                            payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                          },
                          userProfile: new cg(n)
                        }
                      )
                    }
                    return {
                      conversationID: 'GROUP'.concat(e.groupID),
                      type: 'GROUP',
                      lastMessage: {
                        lastTime: e.time,
                        lastSequence: e.messageReadSeq + e.unreadCount,
                        fromAccount: e.msgGroupFromAccount,
                        messageForShow: e.messageShow,
                        type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                        payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                      },
                      groupProfile: new Tg({
                        groupID: e.groupID,
                        name: e.groupNick,
                        avatar: e.groupImage
                      }),
                      unreadCount: e.unreadCount
                    }
                  })
              return (
                t.length > 0 &&
                  this.tim.innerEmitter.emit(Sp.CONVERSATION_LIST_PROFILE_UPDATED, { data: t }),
                n
              )
            }
          },
          {
            key: '_emitConversationUpdate',
            value: function() {
              var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],
                t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
                n = bn(this.conversationMap.values())
              t && this.tim.innerEmitter.emit(Sp.CONVERSATION_LIST_UPDATED, n),
                e && this.tim.outerEmitter.emit(on.CONVERSATION_LIST_UPDATED, n)
            }
          },
          {
            key: '_conversationMapTreeShaking',
            value: function(e) {
              var t = this,
                n = new Map(bn(this.conversationMap))
              e.forEach(function(e) {
                return n.delete(e.conversationID)
              }),
                n.has(an.CONV_SYSTEM) && n.delete(an.CONV_SYSTEM)
              var r = this.tim.groupController.getJoinedAVChatRoom()
              r && n.delete(''.concat(an.CONV_GROUP).concat(r.groupID)),
                bn(n.keys()).forEach(function(e) {
                  return t.conversationMap.delete(e)
                })
            }
          },
          {
            key: 'reset',
            value: function() {
              ;(this.pagingStatus = yu.PAGING_CONVERSATION.NOT_START),
                (this.pagingTimeStamp = 0),
                this.conversationMap.clear(),
                this.resetReady(),
                this.tim.innerEmitter.once(
                  Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED,
                  this._initLocalConversationList,
                  this
                )
            }
          }
        ]),
        t
      )
    })(wp),
    Ng = (1).toFixed,
    Rg = Math.floor,
    Lg = function(e, t, n) {
      return 0 === t ? n : t % 2 == 1 ? Lg(e, t - 1, n * e) : Lg(e * e, t / 2, n)
    },
    Pg =
      (Ng &&
        ('0.000' !== (8e-5).toFixed(3) ||
          '1' !== (0.9).toFixed(0) ||
          '1.25' !== (1.255).toFixed(2) ||
          '1000000000000000128' !== (0xde0b6b3a7640080).toFixed(0))) ||
      !o(function() {
        Ng.call({})
      })
  Ne(
    { target: 'Number', proto: !0, forced: Pg },
    {
      toFixed: function(e) {
        var t,
          n,
          r,
          o,
          i = (function(e) {
            if ('number' != typeof e && 'Number' != p(e)) throw TypeError('Incorrect invocation')
            return +e
          })(this),
          a = ie(e),
          s = [0, 0, 0, 0, 0, 0],
          u = '',
          c = '0',
          l = function(e, t) {
            for (var n = -1, r = t; ++n < 6; ) (r += e * s[n]), (s[n] = r % 1e7), (r = Rg(r / 1e7))
          },
          h = function(e) {
            for (var t = 6, n = 0; --t >= 0; ) (n += s[t]), (s[t] = Rg(n / e)), (n = (n % e) * 1e7)
          },
          f = function() {
            for (var e = 6, t = ''; --e >= 0; )
              if ('' !== t || 0 === e || 0 !== s[e]) {
                var n = String(s[e])
                t = '' === t ? n : t + no.call('0', 7 - n.length) + n
              }
            return t
          }
        if (a < 0 || a > 20) throw RangeError('Incorrect fraction digits')
        if (i != i) return 'NaN'
        if (i <= -1e21 || i >= 1e21) return String(i)
        if ((i < 0 && ((u = '-'), (i = -i)), i > 1e-21))
          if (
            ((n =
              (t =
                (function(e) {
                  for (var t = 0, n = e; n >= 4096; ) (t += 12), (n /= 4096)
                  for (; n >= 2; ) (t += 1), (n /= 2)
                  return t
                })(i * Lg(2, 69, 1)) - 69) < 0
                ? i * Lg(2, -t, 1)
                : i / Lg(2, t, 1)),
            (n *= 4503599627370496),
            (t = 52 - t) > 0)
          ) {
            for (l(0, n), r = a; r >= 7; ) l(1e7, 0), (r -= 7)
            for (l(Lg(10, r, 1), 0), r = t - 1; r >= 23; ) h(1 << 23), (r -= 23)
            h(1 << r), l(1, 1), h(2), (c = f())
          } else l(0, n), l(1 << -t, 0), (c = f() + no.call('0', a))
        return (c =
          a > 0
            ? u +
              ((o = c.length) <= a
                ? '0.' + no.call('0', a - o) + c
                : c.slice(0, o - a) + '.' + c.slice(o - a))
            : u + c)
      }
    }
  )
  var kg = (function() {
      function e(t) {
        if ((In(this, e), void 0 === t))
          throw new np({
            code: rp.MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS,
            message: op.MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS
          })
        if (void 0 === t.tim)
          throw new np({
            code: rp.MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS,
            message: ''.concat(op.MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS, '.tim')
          })
        ;(this.list = new Map()), (this.tim = t.tim), this._initializeOptions(t)
      }
      return (
        Tn(e, [
          {
            key: 'getLocalOldestMessageByConversationID',
            value: function(e) {
              if (!e) return null
              if (!this.list.has(e)) return null
              var t = this.list.get(e).values()
              return t ? t.next().value : null
            }
          },
          {
            key: '_initializeOptions',
            value: function(e) {
              this.options = {}
              var t = {
                memory: { maxDatasPerKey: 100, maxBytesPerData: 256, maxKeys: 0 },
                cache: { maxDatasPerKey: 10, maxBytesPerData: 256, maxKeys: 0 }
              }
              for (var n in t)
                if (Object.prototype.hasOwnProperty.call(t, n)) {
                  if (void 0 === e[n]) {
                    this.options[n] = t[n]
                    continue
                  }
                  var r = t[n]
                  for (var o in r)
                    if (Object.prototype.hasOwnProperty.call(r, o)) {
                      if (void 0 === e[n][o]) {
                        this.options[n][o] = r[o]
                        continue
                      }
                      this.options[n][o] = e[n][o]
                    }
                }
            }
          },
          {
            key: 'pushIn',
            value: function(e) {
              var t = e.conversationID,
                n = e.ID,
                r = !0
              return (
                this.list.has(t) || this.list.set(t, new Map()),
                this.list.has(t) && this.list.get(t).has(n) ? (r = !1) : this.list.get(t).set(n, e),
                r
              )
            }
          },
          {
            key: 'unshift',
            value: function(e) {
              Ks(e)
                ? e.length > 0 && this._unshiftMultipleMessages(e)
                : this._unshiftSingleMessage(e)
            }
          },
          {
            key: '_unshiftSingleMessage',
            value: function(e) {
              var t = e.conversationID,
                n = e.ID
              if (!this.list.has(t))
                return this.list.set(t, new Map()), void this.list.get(t).set(n, e)
              var r = Array.from(this.list.get(t))
              r.unshift([n, e]), this.list.set(t, new Map(r))
            }
          },
          {
            key: '_unshiftMultipleMessages',
            value: function(e) {
              for (
                var t = e.length,
                  n = [],
                  r = e[0].conversationID,
                  o = this.list.has(r) ? Array.from(this.list.get(r)) : [],
                  i = 0;
                i < t;
                i++
              )
                n.push([e[i].ID, e[i]])
              this.list.set(r, new Map(n.concat(o)))
            }
          },
          {
            key: 'remove',
            value: function(e) {
              var t = e.conversationID,
                n = e.ID
              this.list.has(t) && this.list.get(t).delete(n)
            }
          },
          {
            key: 'revoke',
            value: function(e, t, n) {
              if ((Gs.debug('revoke message', e, t, n), this.list.has(e))) {
                var r = this.list.get(e),
                  o = !0,
                  i = !1,
                  a = void 0
                try {
                  for (var s, u = r[Symbol.iterator](); !(o = (s = u.next()).done); o = !0) {
                    var c = wn(s.value, 2)[1]
                    if (c.sequence === t && !c.isRevoked && (Bs(n) || c.random === n))
                      return (c.isRevoked = !0), c
                  }
                } catch (l) {
                  ;(i = !0), (a = l)
                } finally {
                  try {
                    o || null == u.return || u.return()
                  } finally {
                    if (i) throw a
                  }
                }
              }
              return null
            }
          },
          {
            key: 'removeByConversationID',
            value: function(e) {
              this.list.has(e) && this.list.delete(e)
            }
          },
          {
            key: 'hasLocalMessageList',
            value: function(e) {
              return this.list.has(e)
            }
          },
          {
            key: 'getLocalMessageList',
            value: function(e) {
              return this.hasLocalMessageList(e) ? bn(this.list.get(e).values()) : []
            }
          },
          {
            key: 'hasLocalMessage',
            value: function(e, t) {
              return !!this.hasLocalMessageList(e) && this.list.get(e).has(t)
            }
          },
          {
            key: 'getLocalMessage',
            value: function(e, t) {
              return this.hasLocalMessage(e, t) ? this.list.get(e).get(t) : null
            }
          },
          {
            key: 'reset',
            value: function() {
              this.list.clear()
            }
          }
        ]),
        e
      )
    })(),
    Gg = (function() {
      function e(t) {
        In(this, e), (this.tim = t)
      }
      return (
        Tn(e, [
          {
            key: 'setMessageRead',
            value: function(e) {
              var t = e.conversationID,
                n = e.messageID,
                r = this.tim.conversationController.getLocalConversation(t)
              if (!r || 0 === r.unreadCount) return Vp()
              var o = n ? this.tim.messageController.getLocalMessage(t, n) : null
              switch (r.type) {
                case an.CONV_C2C:
                  return this._setC2CMessageRead({
                    conversationID: t,
                    lastMessageTime: o ? o.time : r.lastMessage.lastTime
                  })
                case an.CONV_GROUP:
                  return this._setGroupMessageRead({
                    conversationID: t,
                    lastMessageSeq: o ? o.sequence : r.lastMessage.lastSequence
                  })
                case an.CONV_SYSTEM:
                  return (r.unreadCount = 0), Vp()
                default:
                  return Vp()
              }
            }
          },
          {
            key: '_setC2CMessageRead',
            value: function(e) {
              var t = e.conversationID,
                n = e.lastMessageTime,
                r = this.tim.messageController.createPackage({
                  name: 'conversation',
                  action: 'setC2CMessageRead',
                  param: {
                    C2CMsgReaded: {
                      cookie: '',
                      C2CMsgReadedItem: [{ toAccount: t.replace('C2C', ''), lastMessageTime: n }]
                    }
                  }
                })
              return (
                this._updateIsReadAfterReadReport({ conversationID: t, lastMessageTime: n }),
                this._updateUnreadCount(t),
                this.tim.connectionController
                  .request(r)
                  .then(function() {
                    return new xp()
                  })
                  .catch(function(e) {
                    return Kp(e)
                  })
              )
            }
          },
          {
            key: '_setGroupMessageRead',
            value: function(e) {
              var t = e.conversationID,
                n = e.lastMessageSeq,
                r = this.tim.messageController.createPackage({
                  name: 'conversation',
                  action: 'setGroupMessageRead',
                  param: { groupID: t.replace('GROUP', ''), messageReadSeq: n }
                })
              return (
                this._updateIsReadAfterReadReport({ conversationID: t, lastMessageSeq: n }),
                this._updateUnreadCount(t),
                this.tim.connectionController
                  .request(r)
                  .then(function() {
                    return new xp()
                  })
                  .catch(function(e) {
                    return Kp(e)
                  })
              )
            }
          },
          {
            key: '_updateUnreadCount',
            value: function(e) {
              var t = this.tim,
                n = t.conversationController,
                r = t.messageController,
                o = n.getLocalConversation(e),
                i = r.getLocalMessageList(e)
              o &&
                (o.unreadCount = i.filter(function(e) {
                  return !e.isRead
                }).length)
            }
          },
          {
            key: '_updateIsReadAfterReadReport',
            value: function(e) {
              var t = e.conversationID,
                n = e.lastMessageSeq,
                r = e.lastMessageTime,
                o = this.tim.messageController.getLocalMessageList(t)
              if (0 !== o.length)
                for (var i = o.length - 1; i >= 0; i--) {
                  var a = o[i]
                  if (!((r && a.time > r) || (n && a.sequence > n))) {
                    if ('in' === a.flow && a.isRead) break
                    a.setIsRead(!0)
                  }
                }
            }
          },
          {
            key: 'updateIsRead',
            value: function(e) {
              var t = this.tim,
                n = t.conversationController,
                r = t.messageController,
                o = n.getLocalConversation(e),
                i = r.getLocalMessageList(e)
              if (o && 0 !== i.length && !pu(o.type)) {
                for (var a = [], s = 0; s < i.length; s++)
                  'in' !== i[s].flow
                    ? 'out' !== i[s].flow || i[s].isRead || i[s].setIsRead(!0)
                    : a.push(i[s])
                var u = 0
                if (o.type === an.CONV_C2C) {
                  var c = a.slice(-o.unreadCount).filter(function(e) {
                    return e.isRevoked
                  }).length
                  u = a.length - o.unreadCount - c
                } else u = a.length - o.unreadCount
                for (var l = 0; l < u && !a[l].isRead; l++) a[l].setIsRead(!0)
              }
            }
          }
        ]),
        e
      )
    })(),
    wg = He.findIndex,
    bg = !0
  'findIndex' in [] &&
    Array(1).findIndex(function() {
      bg = !1
    }),
    Ne(
      { target: 'Array', proto: !0, forced: bg },
      {
        findIndex: function(e) {
          return wg(this, e, arguments.length > 1 ? arguments[1] : void 0)
        }
      }
    ),
    Fr('findIndex')
  var Ug = (function() {
      function e(t) {
        var n = t.tim,
          r = t.messageController
        In(this, e),
          (this.tim = n),
          (this.messageController = r),
          (this.completedMap = new Map()),
          this._initListener()
      }
      return (
        Tn(e, [
          {
            key: 'getMessageList',
            value: function(e) {
              var t = this,
                n = e.conversationID,
                r = e.nextReqMessageID,
                o = e.count
              if (this.tim.groupController.checkJoinedAVChatRoomByID(n.replace('GROUP', '')))
                return Vp({ messageList: [], nextReqMessageID: '', isCompleted: !0 })
              ;(Bs(o) || o > 15) && (o = 15)
              var i = this._computeLeftCount({ conversationID: n, nextReqMessageID: r })
              return this._needGetHistory({ conversationID: n, leftCount: i, count: o })
                ? this.messageController
                    .getHistoryMessages({ conversationID: n, count: 20 })
                    .then(function() {
                      return (
                        (i = t._computeLeftCount({ conversationID: n, nextReqMessageID: r })),
                        new xp(
                          t._computeResult({
                            conversationID: n,
                            nextReqMessageID: r,
                            count: o,
                            leftCount: i
                          })
                        )
                      )
                    })
                : Vp(
                    this._computeResult({
                      conversationID: n,
                      nextReqMessageID: r,
                      count: o,
                      leftCount: i
                    })
                  )
            }
          },
          {
            key: 'setCompleted',
            value: function(e) {
              this.completedMap.set(e, !0)
            }
          },
          {
            key: 'deleteCompletedItem',
            value: function(e) {
              this.completedMap.delete(e)
            }
          },
          {
            key: '_initListener',
            value: function() {
              var e = this
              this.tim.innerEmitter.on(Sp.SDK_READY, function() {
                e.completedMap.set(an.CONV_SYSTEM, !0)
              }),
                this.tim.innerEmitter.on(Sp.AVCHATROOM_JOIN_SUCCESS, function(t) {
                  var n = t.data
                  e.completedMap.set(''.concat(an.CONV_GROUP).concat(n), !0)
                })
            }
          },
          {
            key: '_getMessageListSize',
            value: function(e) {
              return this.messageController.getLocalMessageList(e).length
            }
          },
          {
            key: '_needGetHistory',
            value: function(e) {
              var t = e.conversationID,
                n = e.leftCount,
                r = e.count,
                o = this.tim.conversationController.getLocalConversation(t),
                i = !!o && o.type === an.CONV_SYSTEM,
                a = !!o && o.subType === an.GRP_AVCHATROOM
              return !i && !a && n < r && !this.completedMap.has(t)
            }
          },
          {
            key: '_computeResult',
            value: function(e) {
              var t = e.conversationID,
                n = e.nextReqMessageID,
                r = e.count,
                o = e.leftCount,
                i = this._computeMessageList({ conversationID: t, nextReqMessageID: n, count: r }),
                a = this._computeIsCompleted({ conversationID: t, leftCount: o, count: r })
              return {
                messageList: i,
                nextReqMessageID: this._computeNextReqMessageID({
                  messageList: i,
                  isCompleted: a,
                  conversationID: t
                }),
                isCompleted: a
              }
            }
          },
          {
            key: '_computeNextReqMessageID',
            value: function(e) {
              var t = e.messageList,
                n = e.isCompleted,
                r = e.conversationID
              if (!n) return 0 === t.length ? '' : t[0].ID
              var o = this.messageController.getLocalMessageList(r)
              return 0 === o.length ? '' : o[0].ID
            }
          },
          {
            key: '_computeMessageList',
            value: function(e) {
              var t = e.conversationID,
                n = e.nextReqMessageID,
                r = e.count,
                o = this.messageController.getLocalMessageList(t),
                i = this._computeIndexEnd({ nextReqMessageID: n, messageList: o }),
                a = this._computeIndexStart({ indexEnd: i, count: r })
              return o.slice(a, i)
            }
          },
          {
            key: '_computeIndexEnd',
            value: function(e) {
              var t = e.messageList,
                n = void 0 === t ? [] : t,
                r = e.nextReqMessageID
              return r
                ? n.findIndex(function(e) {
                    return e.ID === r
                  })
                : n.length
            }
          },
          {
            key: '_computeIndexStart',
            value: function(e) {
              var t = e.indexEnd,
                n = e.count
              return t > n ? t - n : 0
            }
          },
          {
            key: '_computeLeftCount',
            value: function(e) {
              var t = e.conversationID,
                n = e.nextReqMessageID
              return n
                ? this.messageController.getLocalMessageList(t).findIndex(function(e) {
                    return e.ID === n
                  })
                : this._getMessageListSize(t)
            }
          },
          {
            key: '_computeIsCompleted',
            value: function(e) {
              var t = e.conversationID
              return !!(e.leftCount <= e.count && this.completedMap.has(t))
            }
          },
          {
            key: 'reset',
            value: function() {
              this.completedMap.clear()
            }
          }
        ]),
        e
      )
    })(),
    xg = function e(t) {
      In(this, e), (this.value = t), (this.next = null)
    },
    Fg = (function() {
      function e(t) {
        In(this, e),
          (this.MAX_LENGTH = t),
          (this.pTail = null),
          (this.pNodeToDel = null),
          (this.map = new Map()),
          Gs.log('SinglyLinkedList init MAX_LENGTH='.concat(this.MAX_LENGTH))
      }
      return (
        Tn(e, [
          {
            key: 'pushIn',
            value: function(e) {
              var t = new xg(e)
              if (this.map.size < this.MAX_LENGTH)
                null === this.pTail
                  ? ((this.pTail = t), (this.pNodeToDel = t))
                  : ((this.pTail.next = t), (this.pTail = t)),
                  this.map.set(e, 1)
              else {
                var n = this.pNodeToDel
                ;(this.pNodeToDel = this.pNodeToDel.next),
                  this.map.delete(n.value),
                  (n.next = null),
                  (n = null),
                  (this.pTail.next = t),
                  (this.pTail = t),
                  this.map.set(e, 1)
              }
            }
          },
          {
            key: 'has',
            value: function(e) {
              return this.map.has(e)
            }
          },
          {
            key: 'reset',
            value: function() {
              for (var e; null !== this.pNodeToDel; )
                (e = this.pNodeToDel),
                  (this.pNodeToDel = this.pNodeToDel.next),
                  (e.next = null),
                  (e = null)
              ;(this.pTail = null), this.map.clear()
            }
          }
        ]),
        e
      )
    })(),
    qg = (function() {
      function e(t) {
        In(this, e), (this.tim = t)
      }
      return (
        Tn(e, [
          {
            key: 'upload',
            value: function(e) {
              switch (e.type) {
                case an.MSG_IMAGE:
                  return this._uploadImage(e)
                case an.MSG_FILE:
                  return this._uploadFile(e)
                case an.MSG_AUDIO:
                  return this._uploadAudio(e)
                case an.MSG_VIDEO:
                  return this._uploadVideo(e)
                default:
                  return Promise.resolve()
              }
            }
          },
          {
            key: '_uploadImage',
            value: function(e) {
              var t = this.tim,
                n = t.uploadController,
                r = t.messageController,
                o = e.getElements()[0],
                i = r.getMessageOptionByID(e.messageID)
              return n
                .uploadImage({
                  file: i.payload.file,
                  to: i.to,
                  onProgress: function(e) {
                    if ((o.updatePercent(e), js(i.onProgress)))
                      try {
                        i.onProgress(e)
                      } catch (t) {
                        return Kp(
                          new np({
                            code: rp.MESSAGE_ONPROGRESS_FUNCTION_ERROR,
                            message: ''.concat(op.MESSAGE_ONPROGRESS_FUNCTION_ERROR)
                          })
                        )
                      }
                  }
                })
                .then(function(e) {
                  var t,
                    n = e.location,
                    r = e.fileType,
                    i = e.fileSize,
                    a = su(n)
                  return (
                    o.updateImageFormat(r),
                    o.updateImageInfoArray({ size: i, url: a }),
                    (t = o._imageMemoryURL),
                    es
                      ? new Promise(function(e, n) {
                          wx.getImageInfo({
                            src: t,
                            success: function(t) {
                              e({ width: t.width, height: t.height })
                            },
                            fail: function() {
                              e({ width: 0, height: 0 })
                            }
                          })
                        })
                      : us && 9 === cs
                      ? Promise.resolve({ width: 0, height: 0 })
                      : new Promise(function(e, n) {
                          var r = new Image()
                          ;(r.onload = function() {
                            e({ width: this.width, height: this.height }), (r = null)
                          }),
                            (r.onerror = function() {
                              e({ width: 0, height: 0 }), (r = null)
                            }),
                            (r.src = t)
                        })
                  )
                })
                .then(function(t) {
                  var n = t.width,
                    r = t.height
                  return o.updateImageInfoArray({ width: n, height: r }), e
                })
            }
          },
          {
            key: '_uploadFile',
            value: function(e) {
              var t = this.tim,
                n = t.uploadController,
                r = t.messageController,
                o = e.getElements()[0],
                i = r.getMessageOptionByID(e.messageID)
              return n
                .uploadFile({
                  file: i.payload.file,
                  to: i.to,
                  onProgress: function(e) {
                    if ((o.updatePercent(e), js(i.onProgress)))
                      try {
                        i.onProgress(e)
                      } catch (t) {
                        return Kp(
                          new np({
                            code: rp.MESSAGE_ONPROGRESS_FUNCTION_ERROR,
                            message: ''.concat(op.MESSAGE_ONPROGRESS_FUNCTION_ERROR)
                          })
                        )
                      }
                  }
                })
                .then(function(t) {
                  var n = t.location,
                    r = su(n)
                  return o.updateFileUrl(r), e
                })
            }
          },
          {
            key: '_uploadAudio',
            value: function(e) {
              var t = this.tim,
                n = t.uploadController,
                r = t.messageController,
                o = e.getElements()[0],
                i = r.getMessageOptionByID(e.messageID)
              return n
                .uploadAudio({
                  file: i.payload.file,
                  to: i.to,
                  onProgress: function(e) {
                    if ((o.updatePercent(e), js(i.onProgress)))
                      try {
                        i.onProgress(e)
                      } catch (t) {
                        return Kp(
                          new np({
                            code: rp.MESSAGE_ONPROGRESS_FUNCTION_ERROR,
                            message: ''.concat(op.MESSAGE_ONPROGRESS_FUNCTION_ERROR)
                          })
                        )
                      }
                  }
                })
                .then(function(t) {
                  var n = t.location,
                    r = su(n)
                  return o.updateAudioUrl(r), e
                })
            }
          },
          {
            key: '_uploadVideo',
            value: function(e) {
              var t = this.tim,
                n = t.uploadController,
                r = t.messageController,
                o = e.getElements()[0],
                i = r.getMessageOptionByID(e.messageID)
              return n
                .uploadVideo({
                  file: i.payload.file,
                  to: i.to,
                  onProgress: function(e) {
                    if ((o.updatePercent(e), js(i.onProgress)))
                      try {
                        i.onProgress(e)
                      } catch (t) {
                        return Kp(
                          new np({
                            code: rp.MESSAGE_ONPROGRESS_FUNCTION_ERROR,
                            message: ''.concat(op.MESSAGE_ONPROGRESS_FUNCTION_ERROR)
                          })
                        )
                      }
                  }
                })
                .then(function(t) {
                  if (es) {
                    var n = su(t.location)
                    return o.updateVideoUrl(n), e
                  }
                })
            }
          }
        ]),
        e
      )
    })(),
    Vg = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          (n = Gn(this, Nn(t).call(this, e)))._initializeMembers(),
          n._initializeListener(),
          n._initialzeHandlers(),
          (n.messageOptionMap = new Map()),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initializeMembers',
            value: function() {
              ;(this.messagesList = new kg({ tim: this.tim })),
                (this.currentMessageKey = {}),
                (this.singlyLinkedList = new Fg(100))
            }
          },
          {
            key: '_initialzeHandlers',
            value: function() {
              ;(this.readReportHandler = new Gg(this.tim)),
                (this.getMessageHandler = new Ug({ messageController: this, tim: this.tim })),
                (this.uploadFileHandler = new qg(this.tim))
            }
          },
          {
            key: 'reset',
            value: function() {
              this.messagesList.reset(),
                (this.currentMessageKey = {}),
                this.getMessageHandler.reset(),
                this.singlyLinkedList.reset(),
                this.messageOptionMap.clear()
            }
          },
          {
            key: '_initializeListener',
            value: function() {
              var e = this.tim.innerEmitter
              e.on(Sp.NOTICE_LONGPOLL_NEW_C2C_NOTICE, this._onReceiveC2CMessage, this),
                e.on(Sp.SYNC_MESSAGE_C2C_PROCESSING, this._onSyncMessagesProcessing, this),
                e.on(Sp.SYNC_MESSAGE_C2C_FINISHED, this._onSyncMessagesFinished, this),
                e.on(Sp.NOTICE_LONGPOLL_NEW_GROUP_MESSAGES, this._onReceiveGroupMessage, this),
                e.on(Sp.NOTICE_LONGPOLL_NEW_GROUP_TIPS, this._onReceiveGroupTips, this),
                e.on(Sp.NOTICE_LONGPOLL_NEW_GROUP_NOTICE, this._onReceiveSystemNotice, this),
                e.on(
                  Sp.NOTICE_LONGPOLL_GROUP_MESSAGE_REVOKED,
                  this._onReceiveGroupMessageRevokedNotice,
                  this
                ),
                e.on(
                  Sp.NOTICE_LONGPOLL_C2C_MESSAGE_REVOKED,
                  this._onReceiveC2CMessageRevokedNotice,
                  this
                ),
                e.on(Sp.CONVERSATION_DELETED, this._clearConversationMessages, this)
            }
          },
          {
            key: 'sendMessageInstance',
            value: function(e) {
              var t,
                n = this,
                r = this.tim,
                o = r.innerEmitter,
                i = r.sumStatController,
                a = null
              switch (e.conversationType) {
                case an.CONV_C2C:
                  a = this._handleOnSendC2CMessageSuccess.bind(this)
                  break
                case an.CONV_GROUP:
                  a = this._handleOnSendGroupMessageSuccess.bind(this)
                  break
                default:
                  return Kp(
                    new np({
                      code: rp.MESSAGE_SEND_INVALID_CONVERSATION_TYPE,
                      message: op.MESSAGE_SEND_INVALID_CONVERSATION_TYPE
                    })
                  )
              }
              return (
                this.singlyLinkedList.pushIn(e.random),
                this.uploadFileHandler
                  .upload(e)
                  .then(function() {
                    var r = null
                    return e.isSendable()
                      ? (i.addTotalCount(Bp.SEND_MESSAGE),
                        (t = Date.now()),
                        e.conversationType === an.CONV_C2C
                          ? (r = n._createC2CMessagePack(e))
                          : e.conversationType === an.CONV_GROUP &&
                            (r = n._createGroupMessagePack(e)),
                        n.tim.connectionController.request(r))
                      : Kp({
                          code: rp.MESSAGE_FILE_URL_IS_EMPTY,
                          message: op.MESSAGE_FILE_URL_IS_EMPTY
                        })
                  })
                  .then(function(r) {
                    return (
                      i.addSuccessCount(Bp.SEND_MESSAGE),
                      i.addCost(Bp.SEND_MESSAGE, Math.abs(Date.now() - t)),
                      e.conversationType === an.CONV_GROUP &&
                        ((e.sequence = r.data.sequence),
                        (e.time = r.data.time),
                        e.generateMessageID(n.tim.context.identifier)),
                      n.messagesList.pushIn(e),
                      a(e, r.data),
                      n.messageOptionMap.delete(e.messageID),
                      o.emit(Sp.MESSAGE_SENT, {
                        data: {
                          eventDataList: [
                            {
                              conversationID: e.conversationID,
                              unreadCount: 0,
                              type: e.conversationType,
                              subType: e.conversationSubType,
                              lastMessage: e
                            }
                          ]
                        }
                      }),
                      new xp({ message: e })
                    )
                  })
                  .catch(function(t) {
                    e.status = yu.MESSAGE_STATUS.FAIL
                    var r = new Hp()
                    return (
                      r
                        .setMethod(jp.SEND_MESSAGE)
                        .setMessageType(e.type)
                        .setText(
                          ''
                            .concat(n._generateTjgID(e), '-')
                            .concat(e.type, '-')
                            .concat(e.from, '-')
                            .concat(e.to)
                        )
                        .setStart(),
                      n.probeNetwork().then(function(e, n) {
                        r.setError(t, e, n).setEnd()
                      }),
                      Gs.error('MessageController.sendMessageInstance error:', t),
                      Kp(
                        new np({
                          code: t && t.code ? t.code : rp.MESSAGE_SEND_FAIL,
                          message: t && t.message ? t.message : op.MESSAGE_SEND_FAIL,
                          data: { message: e }
                        })
                      )
                    )
                  })
              )
            }
          },
          {
            key: 'resendMessage',
            value: function(e) {
              return (
                (e.isResend = !0),
                (e.status = yu.MESSAGE_STATUS.UNSEND),
                this.sendMessageInstance(e)
              )
            }
          },
          {
            key: '_isFileLikeMessage',
            value: function(e) {
              return [an.MSG_IMAGE, an.MSG_FILE, an.MSG_AUDIO, an.MSG_VIDEO].indexOf(e.type) >= 0
            }
          },
          { key: '_resendBinaryTypeMessage', value: function() {} },
          {
            key: '_createC2CMessagePack',
            value: function(e) {
              return this.createPackage({
                name: 'c2cMessage',
                action: 'create',
                tjgID: this._generateTjgID(e),
                param: {
                  toAccount: e.to,
                  msgBody: e.getElements(),
                  msgSeq: e.sequence,
                  msgRandom: e.random
                }
              })
            }
          },
          {
            key: '_handleOnSendC2CMessageSuccess',
            value: function(e, t) {
              var n = this.tim.innerEmitter
              ;(e.status = yu.MESSAGE_STATUS.SUCCESS),
                (e.time = t.time),
                n.emit(Sp.MESSAGE_C2C_SEND_SUCCESS, {
                  data: {
                    eventDataList: [
                      {
                        conversationID: e.conversationID,
                        unreadCount: 0,
                        type: e.conversationType,
                        subType: e.conversationSubType,
                        lastMessage: e
                      }
                    ]
                  }
                })
            }
          },
          {
            key: '_createGroupMessagePack',
            value: function(e) {
              return this.createPackage({
                name: 'groupMessage',
                action: 'create',
                tjgID: this._generateTjgID(e),
                param: {
                  groupID: e.to,
                  msgBody: e.getElements(),
                  random: e.random,
                  clientSequence: e.clientSequence
                }
              })
            }
          },
          {
            key: '_handleOnSendGroupMessageSuccess',
            value: function(e, t) {
              var n = this.tim.innerEmitter
              ;(e.sequence = t.sequence),
                (e.time = t.time),
                (e.status = yu.MESSAGE_STATUS.SUCCESS),
                n.emit(Sp.MESSAGE_GROUP_SEND_SUCCESS, {
                  data: {
                    eventDataList: [
                      {
                        conversationID: e.conversationID,
                        unreadCount: 0,
                        type: e.conversationType,
                        subType: e.conversationSubType,
                        lastMessage: e
                      }
                    ]
                  }
                })
            }
          },
          {
            key: '_onReceiveC2CMessage',
            value: function(e) {
              Gs.debug('MessageController._onReceiveC2CMessage nums='.concat(e.data.length))
              var t = this.tim,
                n = t.innerEmitter,
                r = t.outerEmitter,
                o = this._newC2CMessageStoredAndSummary({
                  notifiesList: e.data,
                  type: an.CONV_C2C,
                  C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }),
                i = o.eventDataList,
                a = o.result
              i.length > 0 &&
                n.emit(Sp.MESSAGE_C2C_INSTANT_RECEIVED, {
                  data: { eventDataList: i, result: a },
                  resource: this
                }),
                a.length > 0 && r.emit(on.MESSAGE_RECEIVED, a)
            }
          },
          {
            key: '_onReceiveGroupMessage',
            value: function(e) {
              Gs.debug('MessageController._onReceiveGroupMessage nums='.concat(e.data.length))
              var t = this.tim,
                n = t.outerEmitter,
                r = t.innerEmitter,
                o = this.newGroupMessageStoredAndSummary(e.data),
                i = o.eventDataList,
                a = o.result
              i.length > 0 &&
                r.emit(Sp.MESSAGE_GROUP_INSTANT_RECEIVED, {
                  data: { eventDataList: i, result: a, isGroupTip: !1 }
                }),
                a.length > 0 && n.emit(on.MESSAGE_RECEIVED, a)
            }
          },
          {
            key: '_onReceiveGroupTips',
            value: function(e) {
              var t = this.tim,
                n = t.outerEmitter,
                r = t.innerEmitter,
                o = e.data
              Gs.debug('MessageController._onReceiveGroupTips nums='.concat(o.length))
              var i = this.newGroupTipsStoredAndSummary(o),
                a = i.eventDataList,
                s = i.result
              a.length > 0 &&
                r.emit(Sp.MESSAGE_GROUP_INSTANT_RECEIVED, {
                  data: { eventDataList: a, result: s, isGroupTip: !0 }
                }),
                s.length > 0 && n.emit(on.MESSAGE_RECEIVED, s)
            }
          },
          {
            key: '_onReceiveSystemNotice',
            value: function(e) {
              var t = this.tim,
                n = t.outerEmitter,
                r = t.innerEmitter,
                o = e.data,
                i = o.groupSystemNotices,
                a = o.type
              Gs.debug('MessageController._onReceiveSystemNotice nums='.concat(i.length))
              var s = this.newSystemNoticeStoredAndSummary({ notifiesList: i, type: a }),
                u = s.eventDataList,
                c = s.result
              u.length > 0 &&
                r.emit(Sp.MESSAGE_GROUP_SYSTEM_NOTICE_RECEIVED, {
                  data: { eventDataList: u, result: c, type: a }
                }),
                c.length > 0 && 'poll' === a && n.emit(on.MESSAGE_RECEIVED, c)
            }
          },
          {
            key: '_onReceiveGroupMessageRevokedNotice',
            value: function(e) {
              var t = this
              Gs.debug(
                'MessageController._onReceiveGroupMessageRevokedNotice nums='.concat(e.data.length)
              )
              var n = [],
                r = null
              e.data.forEach(function(e) {
                e.elements.revokedInfos.forEach(function(e) {
                  ;(r = t.messagesList.revoke('GROUP'.concat(e.groupID), e.sequence)) && n.push(r)
                })
              }),
                0 !== n.length &&
                  (this.tim.innerEmitter.emit(Sp.MESSAGE_REVOKED, { data: n }),
                  this.tim.outerEmitter.emit(on.MESSAGE_REVOKED, n))
            }
          },
          {
            key: '_onReceiveC2CMessageRevokedNotice',
            value: function(e) {
              var t = this
              Gs.debug(
                'MessageController._onReceiveC2CMessageRevokedNotice nums='.concat(e.data.length)
              )
              var n = [],
                r = null
              e.data.forEach(function(e) {
                e.c2cMessageRevokedNotify.revokedInfos.forEach(function(e) {
                  ;(r = t.messagesList.revoke('C2C'.concat(e.from), e.sequence, e.random)) &&
                    n.push(r)
                })
              }),
                0 !== n.length &&
                  (this.tim.innerEmitter.emit(Sp.MESSAGE_REVOKED, { data: n }),
                  this.tim.outerEmitter.emit(on.MESSAGE_REVOKED, n))
            }
          },
          {
            key: '_clearConversationMessages',
            value: function(e) {
              this.messagesList.removeByConversationID(e),
                this.getMessageHandler.deleteCompletedItem(e)
            }
          },
          {
            key: '_pushIntoNoticeResult',
            value: function(e, t) {
              var n = this.messagesList.pushIn(t),
                r = this.singlyLinkedList.has(t.random)
              return !(!n || !1 !== r) && (e.push(t), !0)
            }
          },
          {
            key: '_newC2CMessageStoredAndSummary',
            value: function(e) {
              for (
                var t = e.notifiesList,
                  n = e.type,
                  r = e.C2CRemainingUnreadList,
                  o = e.isFromSync,
                  i = null,
                  a = [],
                  s = [],
                  u = {},
                  c = this.tim.bigDataHallwayController,
                  l = 0,
                  p = t.length;
                l < p;
                l++
              ) {
                var h = t[l]
                if (
                  ((h.currentUser = this.tim.context.identifier),
                  (h.conversationType = n),
                  (h.isSystemMessage = !!h.isSystemMessage),
                  (i = new pp(h)),
                  (h.elements = c.parseElements(h.elements, h.from)),
                  i.setElement(h.elements),
                  !o)
                )
                  if (!this._pushIntoNoticeResult(s, i)) continue
                void 0 === u[i.conversationID]
                  ? (u[i.conversationID] =
                      a.push({
                        conversationID: i.conversationID,
                        unreadCount: 'out' === i.flow ? 0 : 1,
                        type: i.conversationType,
                        subType: i.conversationSubType,
                        lastMessage: i
                      }) - 1)
                  : ((a[u[i.conversationID]].type = i.conversationType),
                    (a[u[i.conversationID]].subType = i.conversationSubType),
                    (a[u[i.conversationID]].lastMessage = i),
                    'in' === i.flow && a[u[i.conversationID]].unreadCount++)
              }
              if (Ks(r))
                for (
                  var f = function(e, t) {
                      var n = a.find(function(t) {
                        return t.conversationID === 'C2C'.concat(r[e].from)
                      })
                      n
                        ? (n.unreadCount += r[e].count)
                        : a.push({
                            conversationID: 'C2C'.concat(r[e].from),
                            unreadCount: r[e].count,
                            type: an.CONV_C2C
                          })
                    },
                    g = 0,
                    d = r.length;
                  g < d;
                  g++
                )
                  f(g)
              return { eventDataList: a, result: s }
            }
          },
          {
            key: 'newGroupMessageStoredAndSummary',
            value: function(e) {
              for (
                var t = null,
                  n = [],
                  r = {},
                  o = [],
                  i = an.CONV_GROUP,
                  a = this.tim.bigDataHallwayController,
                  s = 0,
                  u = e.length;
                s < u;
                s++
              ) {
                var c = e[s]
                ;(c.currentUser = this.tim.context.identifier),
                  (c.conversationType = i),
                  (c.isSystemMessage = !!c.isSystemMessage),
                  (t = new pp(c)),
                  (c.elements = a.parseElements(c.elements, c.from)),
                  t.setElement(c.elements),
                  this._pushIntoNoticeResult(o, t) &&
                    (void 0 === r[t.conversationID]
                      ? (r[t.conversationID] =
                          n.push({
                            conversationID: t.conversationID,
                            unreadCount: 'out' === t.flow ? 0 : 1,
                            type: t.conversationType,
                            subType: t.conversationSubType,
                            lastMessage: t
                          }) - 1)
                      : ((n[r[t.conversationID]].type = t.conversationType),
                        (n[r[t.conversationID]].subType = t.conversationSubType),
                        (n[r[t.conversationID]].lastMessage = t),
                        'in' === t.flow && n[r[t.conversationID]].unreadCount++))
              }
              return { eventDataList: n, result: o }
            }
          },
          {
            key: 'newGroupTipsStoredAndSummary',
            value: function(e) {
              for (var t = null, n = [], r = [], o = {}, i = 0, a = e.length; i < a; i++) {
                var s = e[i]
                ;(s.currentUser = this.tim.context.identifier),
                  (s.conversationType = an.CONV_GROUP),
                  (t = new pp(s)).setElement({
                    type: an.MSG_GRP_TIP,
                    content: An({}, s.elements, { groupProfile: s.groupProfile })
                  }),
                  (t.isSystemMessage = !1),
                  this._pushIntoNoticeResult(r, t) &&
                    (void 0 === o[t.conversationID]
                      ? (o[t.conversationID] =
                          n.push({
                            conversationID: t.conversationID,
                            unreadCount: 'out' === t.flow ? 0 : 1,
                            type: t.conversationType,
                            subType: t.conversationSubType,
                            lastMessage: t
                          }) - 1)
                      : ((n[o[t.conversationID]].type = t.conversationType),
                        (n[o[t.conversationID]].subType = t.conversationSubType),
                        (n[o[t.conversationID]].lastMessage = t),
                        'in' === t.flow && n[o[t.conversationID]].unreadCount++))
              }
              return { eventDataList: n, result: r }
            }
          },
          {
            key: 'newSystemNoticeStoredAndSummary',
            value: function(e) {
              var t = e.notifiesList,
                n = e.type,
                r = null,
                o = t.length,
                i = 0,
                a = [],
                s = {
                  conversationID: an.CONV_SYSTEM,
                  unreadCount: 0,
                  type: an.CONV_SYSTEM,
                  subType: null,
                  lastMessage: null
                }
              for (i = 0; i < o; i++) {
                var u = t[i]
                if (u.elements.operationType !== Gl)
                  (u.currentUser = this.tim.context.identifier),
                    (u.conversationType = an.CONV_SYSTEM),
                    (u.conversationID = an.CONV_SYSTEM),
                    (r = new pp(u)).setElement({
                      type: an.MSG_GRP_SYS_NOTICE,
                      content: An({}, u.elements, { groupProfile: u.groupProfile })
                    }),
                    (r.isSystemMessage = !0),
                    this._pushIntoNoticeResult(a, r) &&
                      ('poll' === n ? s.unreadCount++ : 'sync' === n && r.setIsRead(!0),
                      (s.subType = r.conversationSubType))
              }
              return (
                (s.lastMessage = a[a.length - 1]),
                { eventDataList: a.length > 0 ? [s] : [], result: a }
              )
            }
          },
          {
            key: '_onSyncMessagesProcessing',
            value: function(e) {
              var t = this._newC2CMessageStoredAndSummary({
                  notifiesList: e.data,
                  type: an.CONV_C2C,
                  isFromSync: !0,
                  C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }),
                n = t.eventDataList,
                r = t.result
              this.tim.innerEmitter.emit(Sp.MESSAGE_SYNC_PROCESSING, {
                data: { eventDataList: n, result: r },
                resource: this
              })
            }
          },
          {
            key: '_onSyncMessagesFinished',
            value: function(e) {
              this.triggerReady()
              var t = this._newC2CMessageStoredAndSummary({
                  notifiesList: e.data,
                  type: an.CONV_C2C,
                  isFromSync: !0,
                  C2CRemainingUnreadList: e.C2CRemainingUnreadList
                }),
                n = t.eventDataList,
                r = t.result
              this.tim.innerEmitter.emit(Sp.MESSAGE_SYNC_FINISHED, {
                data: { eventDataList: n, result: r },
                resource: this
              })
            }
          },
          {
            key: 'getHistoryMessages',
            value: function(e) {
              if (e.conversationID === an.CONV_SYSTEM) return Vp()
              !e.count && (e.count = 15), e.count > 20 && (e.count = 20)
              var t = this.messagesList.getLocalOldestMessageByConversationID(e.conversationID)
              t ||
                (((t = {}).time = 0),
                (t.sequence = 0),
                0 === e.conversationID.indexOf(an.CONV_C2C)
                  ? ((t.to = e.conversationID.replace(an.CONV_C2C, '')),
                    (t.conversationType = an.CONV_C2C))
                  : 0 === e.conversationID.indexOf(an.CONV_GROUP) &&
                    ((t.to = e.conversationID.replace(an.CONV_GROUP, '')),
                    (t.conversationType = an.CONV_GROUP)))
              var n = ''
              switch (t.conversationType) {
                case an.CONV_C2C:
                  return (
                    (n = e.conversationID.replace(an.CONV_C2C, '')),
                    this.getC2CRoamMessages({
                      conversationID: e.conversationID,
                      peerAccount: n,
                      count: e.count,
                      lastMessageTime:
                        void 0 === this.currentMessageKey[e.conversationID] ? 0 : t.time
                    })
                  )
                case an.CONV_GROUP:
                  return this.getGroupRoamMessages({
                    conversationID: e.conversationID,
                    groupID: t.to,
                    count: e.count,
                    sequence: t.sequence - 1
                  })
                default:
                  return Vp()
              }
            }
          },
          {
            key: 'getC2CRoamMessages',
            value: function(e) {
              var t = this,
                n = this.tim.connectionController,
                r =
                  void 0 !== this.currentMessageKey[e.conversationID]
                    ? this.currentMessageKey[e.conversationID]
                    : '',
                o = this.createPackage({
                  name: 'c2cMessage',
                  action: 'query',
                  param: {
                    peerAccount: e.peerAccount,
                    count: e.count || 15,
                    lastMessageTime: e.lastMessageTime || 0,
                    messageKey: r
                  }
                })
              return n
                .request(o)
                .then(function(n) {
                  var r = n.data,
                    o = r.complete,
                    i = r.messageList
                  1 === o && t.getMessageHandler.setCompleted(e.conversationID)
                  var a = t._roamMessageStore(i, an.CONV_C2C, e.conversationID)
                  return (
                    t.readReportHandler.updateIsRead(e.conversationID),
                    (t.currentMessageKey[e.conversationID] = n.data.messageKey),
                    a
                  )
                })
                .catch(function(e) {
                  return Kp(e)
                })
            }
          },
          {
            key: 'getC2CRoamMessagesSliced',
            value: function(e) {
              var t = this.tim.connectionController,
                n = this
              return (function(e) {
                return new Promise(function(r, o) {
                  !(function e(r, o, i) {
                    var a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : [],
                      s = n.createPackage({
                        name: 'c2cMessage',
                        action: 'query',
                        param: {
                          peerAccount: r.peerAccount,
                          count: r.count || 15,
                          lastMessageTime: r.lastMessageTime || 0,
                          messageKey: r.messageKey || ''
                        }
                      }),
                      u = t
                        .request(s)
                        .then(function(t) {
                          var s = t.data.messageList,
                            u = n._roamMessageStore(s, an.CONV_C2C)
                          a.push.apply(a, bn(u)),
                            t.data.complete === yu.GET_HISTORY_MESSAGE_STATUS.C2C_IS_NOT_FINISHED
                              ? ((r.messageKey = t.data.messageKey), e(r, o, a))
                              : t.data.complete === yu.GET_HISTORY_MESSAGE_STATUS.C2C_IS_FINISHED
                              ? (Gs.log('getC2CRoamMessages finised...'), o(new xp(a)))
                              : i(
                                  new np({
                                    code: rp.MESSAGE_UNKNOW_ROMA_LIST_END_FLAG_FIELD,
                                    message: op.MESSAGE_UNKNOW_ROMA_LIST_END_FLAG_FIELD
                                  })
                                )
                        })
                        .reject(function(e) {
                          Gs.log('getC2CRoamMessages fail...'), i(e)
                        })
                    return u
                  })(e, r, o, [])
                })
              })(e)
            }
          },
          {
            key: 'getGroupRoamMessages',
            value: function(e) {
              var t = this,
                n = this.tim,
                r = n.connectionController,
                o = n.groupController,
                i = e.sequence >= 0 ? e.sequence : o.getLocalGroupLastSequence(e.groupID)
              if (i < 0) return Vp([])
              var a = this.createPackage({
                name: 'groupMessage',
                action: 'query',
                param: { groupID: e.groupID, count: 21, sequence: i }
              })
              return r
                .request(a)
                .then(function(n) {
                  var r = n.data,
                    o = r.messageList,
                    i = r.complete,
                    a = 'GROUP'.concat(e.groupID)
                  if (2 === i || gu(o)) return t.getMessageHandler.setCompleted(a), []
                  var s = t._roamMessageStore(o, an.CONV_GROUP, a)
                  return (
                    t.readReportHandler.updateIsRead(a),
                    Gs.log('MessageController.getGroupRoamMessages ok. nums='.concat(s.length)),
                    s
                  )
                })
                .catch(function(e) {
                  return Gs.log('MessageController.getGroupRoamMessages error', e), Kp(e)
                })
            }
          },
          {
            key: '_roamMessageStore',
            value: function() {
              var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [],
                t = arguments.length > 1 ? arguments[1] : void 0,
                n = arguments.length > 2 ? arguments[2] : void 0,
                r = null,
                o = [],
                i = 0,
                a = e.length,
                s = null,
                u = t === an.CONV_GROUP,
                c = this.tim.bigDataHallwayController,
                l = function() {
                  ;(i = u ? e.length - 1 : 0), (a = u ? 0 : e.length)
                },
                p = function() {
                  u ? --i : ++i
                },
                h = function() {
                  return u ? i >= a : i < a
                }
              for (l(); h(); p())
                u && 1 === e[i].sequence && this.getMessageHandler.setCompleted(n),
                  1 !== e[i].isPlaceMessage &&
                    (((r = new pp(e[i])).to = e[i].to),
                    (r.isSystemMessage = !!e[i].isSystemMessage),
                    (r.conversationType = t),
                    e[i].event === Tl.JSON.TYPE.GROUP.TIP
                      ? (s = {
                          type: an.MSG_GRP_TIP,
                          content: An({}, e[i].elements, { groupProfile: e[i].groupProfile })
                        })
                      : ((e[i].elements = c.parseElements(e[i].elements, e[i].from)),
                        (s = e[i].elements)),
                    r.setElement(s),
                    r.reInitialize(this.tim.context.identifier),
                    o.push(r))
              return this.messagesList.unshift(o), (l = p = h = null), o
            }
          },
          {
            key: 'getLocalMessageList',
            value: function(e) {
              return this.messagesList.getLocalMessageList(e)
            }
          },
          {
            key: 'getLocalMessage',
            value: function(e, t) {
              return this.messagesList.getLocalMessage(e, t)
            }
          },
          {
            key: 'hasLocalMessage',
            value: function(e, t) {
              return this.messagesList.hasLocalMessage(e, t)
            }
          },
          {
            key: 'deleteLocalMessage',
            value: function(e) {
              e instanceof pp && this.messagesList.remove(e)
            }
          },
          {
            key: 'revokeMessage',
            value: function(e) {
              var t,
                n = this
              e.conversationType === an.CONV_C2C
                ? (t = this.createPackage({
                    name: 'c2cMessageWillBeRevoked',
                    action: 'create',
                    param: {
                      msgInfo: {
                        fromAccount: e.from,
                        toAccount: e.to,
                        msgSeq: e.sequence,
                        msgRandom: e.random,
                        msgTimeStamp: e.time
                      }
                    }
                  }))
                : e.conversationType === an.CONV_GROUP &&
                  (t = this.createPackage({
                    name: 'groupMessageWillBeRevoked',
                    action: 'create',
                    param: { to: e.to, msgSeqList: [{ msgSeq: e.sequence }] }
                  }))
              var r = new Hp()
              return (
                r
                  .setMethod(jp.REVOKE_MESSAGE)
                  .setMessageType(e.type)
                  .setText(
                    ''
                      .concat(this._generateTjgID(e), '-')
                      .concat(e.type, '-')
                      .concat(e.from, '-')
                      .concat(e.to)
                  )
                  .setStart(),
                this.tim.connectionController
                  .request(t)
                  .then(function(t) {
                    var o = t.data.recallRetList
                    if (!gu(o) && 0 !== o[0].retCode) {
                      var i = new np({
                        code: o[0].retCode,
                        message: tp[o[0].retCode] || op.MESSAGE_REVOKE_FAIL,
                        data: { message: e }
                      })
                      return (
                        r
                          .setCode(i.code)
                          .setMessage(i.message)
                          .setEnd(),
                        Kp(i)
                      )
                    }
                    return (
                      Gs.info('MessageController.revokeMessage ok. ID='.concat(e.ID)),
                      (e.isRevoked = !0),
                      r.setCode(0).setEnd(),
                      n.innerEmitter.emit(Sp.MESSAGE_REVOKED, { data: [e] }),
                      new xp({ message: e })
                    )
                  })
                  .catch(function(t) {
                    n.probeNetwork().then(function(e, n) {
                      r.setError(t, e, n).setEnd()
                    })
                    var o = new np({
                      code: t && t.code ? t.code : rp.MESSAGE_REVOKE_FAIL,
                      message: t && t.message ? t.message : op.MESSAGE_REVOKE_FAIL,
                      data: { message: e }
                    })
                    return (
                      Gs.warn(
                        'MessageController.revokeMessage failed. ID='
                          .concat(e.ID, ' code=')
                          .concat(o.code, ' message=')
                          .concat(o.message)
                      ),
                      Kp(o)
                    )
                  })
              )
            }
          },
          {
            key: 'setMessageRead',
            value: function(e) {
              var t = this
              return new Promise(function(n, r) {
                t.ready(function() {
                  t.readReportHandler
                    .setMessageRead(e)
                    .then(n)
                    .catch(r)
                })
              })
            }
          },
          {
            key: 'getMessageList',
            value: function(e) {
              return this.getMessageHandler.getMessageList(e)
            }
          },
          {
            key: 'createTextMessage',
            value: function(e) {
              e.currentUser = this.tim.context.identifier
              var t = new pp(e),
                n = 'string' == typeof e.payload ? e.payload : e.payload.text,
                r = new vu({ text: n })
              return t.setElement(r), t
            }
          },
          {
            key: 'createCustomMessage',
            value: function(e) {
              e.currentUser = this.tim.context.identifier
              var t = new pp(e),
                n = new up({
                  data: e.payload.data,
                  description: e.payload.description,
                  extension: e.payload.extension
                })
              return t.setElement(n), t
            }
          },
          {
            key: 'createImageMessage',
            value: function(e) {
              e.currentUser = this.tim.context.identifier
              var t = new pp(e)
              if (es) {
                var n = e.payload.file
                if (Us(n))
                  return void Gs.warn(
                    '微信小程序环境下调用 createImageMessage 接口时，payload.file 不支持传入 File 对象'
                  )
                var r = n.tempFilePaths[0],
                  o = {
                    url: r,
                    name: r.slice(r.lastIndexOf('/') + 1),
                    size: n.tempFiles[0].size,
                    type: r.slice(r.lastIndexOf('.') + 1).toLowerCase()
                  }
                e.payload.file = o
              } else if (Za && Us(e.payload.file)) {
                var i = e.payload.file
                e.payload.file = { files: [i] }
              }
              var a = new Bl({
                imageFormat: 'UNKNOWN',
                uuid: this._generateUUID(),
                file: e.payload.file
              })
              return t.setElement(a), this.messageOptionMap.set(t.messageID, e), t
            }
          },
          {
            key: 'createFileMessage',
            value: function(e) {
              if (!es) {
                if (Za && Us(e.payload.file)) {
                  var t = e.payload.file
                  e.payload.file = { files: [t] }
                }
                e.currentUser = this.tim.context.identifier
                var n = new pp(e),
                  r = new sp({ uuid: this._generateUUID(), file: e.payload.file })
                return n.setElement(r), this.messageOptionMap.set(n.messageID, e), n
              }
              Gs.warn('微信小程序目前不支持选择文件， createFileMessage 接口不可用！')
            }
          },
          {
            key: 'createAudioMessage',
            value: function(e) {
              if (es) {
                var t = e.payload.file
                if (es) {
                  var n = {
                    url: t.tempFilePath,
                    name: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('/') + 1),
                    size: t.fileSize,
                    second: parseInt(t.duration) / 1e3,
                    type: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('.') + 1).toLowerCase()
                  }
                  e.payload.file = n
                }
                e.currentUser = this.tim.context.identifier
                var r = new pp(e),
                  o = new jl({
                    second: Math.floor(t.duration / 1e3),
                    size: t.fileSize,
                    url: t.tempFilePath,
                    uuid: this._generateUUID()
                  })
                return r.setElement(o), this.messageOptionMap.set(r.messageID, e), r
              }
              Gs.warn('createAudioMessage 目前只支持微信小程序发语音消息')
            }
          },
          {
            key: 'createVideoMessage',
            value: function(e) {
              if (es) {
                if (((e.currentUser = this.tim.context.identifier), es)) {
                  ;(e.payload.file.thumbUrl =
                    'https://webim-1252463788.cos.ap-shanghai.myqcloud.com/assets/images/transparent.png'),
                    (e.payload.file.thumbSize = 1668)
                  var t = e.payload.file,
                    n = {
                      url: t.tempFilePath,
                      name: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('/') + 1),
                      size: t.size,
                      second: t.duration,
                      type: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('.') + 1).toLowerCase()
                    }
                  e.payload.file.videoFile = n
                  var r = new pp(e),
                    o = new cp({
                      videoFormat: n.type,
                      videoSecond: Number(n.second.toFixed(0)),
                      videoSize: n.size,
                      remoteVideoUrl: '',
                      videoUrl: n.url,
                      videoUUID: this._generateUUID(),
                      thumbUUID: this._generateUUID(),
                      thumbWidth: t.width,
                      thumbHeight: t.height,
                      thumbUrl: t.thumbUrl,
                      thumbSize: t.thumbSize,
                      thumbFormat: t.thumbUrl.slice(t.thumbUrl.lastIndexOf('.') + 1).toLowerCase()
                    })
                  return r.setElement(o), this.messageOptionMap.set(r.messageID, e), r
                }
              } else {
                Gs.warn('createVideoMessage 目前只支持微信小程序发视频消息')
              }
            }
          },
          {
            key: 'createFaceMessage',
            value: function(e) {
              e.currentUser = this.tim.context.identifier
              var t = new pp(e),
                n = new Hl(e.payload)
              return t.setElement(n), t
            }
          },
          {
            key: '_generateUUID',
            value: function() {
              var e = this.tim.context
              return ''
                .concat(e.SDKAppID, '-')
                .concat(e.identifier, '-')
                .concat(
                  (function() {
                    for (var e = '', t = 32; t > 0; --t) e += nu[Math.floor(Math.random() * ru)]
                    return e
                  })()
                )
            }
          },
          {
            key: '_generateTjgID',
            value: function(e) {
              return this.tim.context.tinyID + '-' + e.random
            }
          },
          {
            key: 'getMessageOptionByID',
            value: function(e) {
              return this.messageOptionMap.get(e)
            }
          }
        ]),
        t
      )
    })(wp),
    Kg = (function() {
      function e(t) {
        In(this, e),
          (this.userID = ''),
          (this.avatar = ''),
          (this.nick = ''),
          (this.role = ''),
          (this.joinTime = ''),
          (this.lastSendMsgTime = ''),
          (this.nameCard = ''),
          (this.muteUntil = 0),
          (this.memberCustomField = []),
          this._initMember(t)
      }
      return (
        Tn(e, [
          {
            key: '_initMember',
            value: function(e) {
              this.updateMember(e)
            }
          },
          {
            key: 'updateMember',
            value: function(e) {
              var t = [null, void 0, '', 0, NaN]
              e.memberCustomField && uu(this.memberCustomField, e.memberCustomField),
                Js(this, e, ['memberCustomField'], t)
            }
          },
          {
            key: 'updateRole',
            value: function(e) {
              ;['Owner', 'Admin', 'Member'].indexOf(e) < 0 || (this.role = e)
            }
          },
          {
            key: 'updateMuteUntil',
            value: function(e) {
              Bs(e) || (this.muteUntil = Math.floor((Date.now() + 1e3 * e) / 1e3))
            }
          },
          {
            key: 'updateNameCard',
            value: function(e) {
              Bs(e) || (this.nameCard = e)
            }
          },
          {
            key: 'updateMemberCustomField',
            value: function(e) {
              e && uu(this.memberCustomField, e)
            }
          }
        ]),
        e
      )
    })(),
    Bg = (function() {
      function e(t) {
        In(this, e),
          (this.tim = t.tim),
          (this.groupController = t.groupController),
          this._initListeners()
      }
      return (
        Tn(e, [
          {
            key: '_initListeners',
            value: function() {
              this.tim.innerEmitter.on(
                Sp.MESSAGE_GROUP_INSTANT_RECEIVED,
                this._onReceivedGroupTips,
                this
              )
            }
          },
          {
            key: '_onReceivedGroupTips',
            value: function(e) {
              var t = this,
                n = e.data,
                r = n.result
              n.isGroupTip &&
                r.forEach(function(e) {
                  switch (e.payload.operationType) {
                    case 1:
                      t._onNewMemberComeIn(e)
                      break
                    case 2:
                      t._onMemberQuit(e)
                      break
                    case 3:
                      t._onMemberKickedOut(e)
                      break
                    case 4:
                      t._onMemberSetAdmin(e)
                      break
                    case 5:
                      t._onMemberCancelledAdmin(e)
                      break
                    case 6:
                      t._onGroupProfileModified(e)
                      break
                    case 7:
                      t._onMemberInfoModified(e)
                      break
                    default:
                      Gs.warn(
                        'GroupTipsHandler._onReceivedGroupTips Unhandled groupTips. operationType=',
                        e.payload.operationType
                      )
                  }
                })
            }
          },
          {
            key: '_onNewMemberComeIn',
            value: function(e) {
              var t = e.payload,
                n = t.memberNum,
                r = t.groupProfile.groupID,
                o = this.groupController.getLocalGroupProfile(r)
              o && xs(n) && (o.memberNum = n)
            }
          },
          {
            key: '_onMemberQuit',
            value: function(e) {
              var t = e.payload,
                n = t.memberNum,
                r = t.groupProfile.groupID,
                o = this.groupController.getLocalGroupProfile(r)
              o && xs(n) && (o.memberNum = n),
                this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList)
            }
          },
          {
            key: '_onMemberKickedOut',
            value: function(e) {
              var t = e.payload,
                n = t.memberNum,
                r = t.groupProfile.groupID,
                o = this.groupController.getLocalGroupProfile(r)
              o && xs(n) && (o.memberNum = n),
                this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList)
            }
          },
          {
            key: '_onMemberSetAdmin',
            value: function(e) {
              var t = this,
                n = e.payload.groupProfile.groupID
              e.payload.userIDList.forEach(function(e) {
                var r = t.groupController.getLocalGroupMemberInfo(n, e)
                r && r.updateRole(an.GRP_MBR_ROLE_ADMIN)
              })
            }
          },
          {
            key: '_onMemberCancelledAdmin',
            value: function(e) {
              var t = this,
                n = e.payload.groupProfile.groupID
              e.payload.userIDList.forEach(function(e) {
                var r = t.groupController.getLocalGroupMemberInfo(n, e)
                r && r.updateRole(an.GRP_MBR_ROLE_MEMBER)
              })
            }
          },
          {
            key: '_onGroupProfileModified',
            value: function(e) {
              var t = this,
                n = e.payload.newGroupProfile,
                r = e.payload.groupProfile.groupID,
                o = this.groupController.getLocalGroupProfile(r)
              Object.keys(n).forEach(function(e) {
                switch (e) {
                  case 'ownerID':
                    t._ownerChaged(o, n)
                    break
                  default:
                    o[e] = n[e]
                }
              }),
                this.groupController.emitGroupListUpdate(!0, !0)
            }
          },
          {
            key: '_ownerChaged',
            value: function(e, t) {
              var n = e.groupID,
                r = this.groupController.getLocalGroupProfile(n),
                o = this.tim.context.identifier
              if (o === t.ownerID) {
                r.updateGroup({ selfInfo: { role: an.GRP_MBR_ROLE_OWNER } })
                var i = this.groupController.getLocalGroupMemberInfo(n, o),
                  a = this.groupController.getLocalGroupProfile(n).ownerID,
                  s = this.groupController.getLocalGroupMemberInfo(n, a)
                i && i.updateRole(an.GRP_MBR_ROLE_OWNER), s && s.updateRole(an.GRP_MBR_ROLE_MEMBER)
              }
            }
          },
          {
            key: '_onMemberInfoModified',
            value: function(e) {
              var t = this,
                n = e.payload.groupProfile.groupID
              e.payload.memberList.forEach(function(e) {
                var r = t.groupController.getLocalGroupMemberInfo(n, e.userID)
                r && e.muteTime && r.updateMuteUntil(e.muteTime)
              })
            }
          }
        ]),
        e
      )
    })(),
    Hg = (function() {
      function e(t) {
        In(this, e),
          (this.groupController = t.groupController),
          (this.tim = t.tim),
          (this.pendencyMap = new Map()),
          this._initLiceners()
      }
      return (
        Tn(e, [
          {
            key: '_initLiceners',
            value: function() {
              this.tim.innerEmitter.on(
                Sp.MESSAGE_GROUP_SYSTEM_NOTICE_RECEIVED,
                this._onReceivedGroupSystemNotice,
                this
              ),
                this.tim.innerEmitter.on(
                  Sp.SYNC_MESSAGE_C2C_FINISHED,
                  this._clearGroupSystemNotice,
                  this
                )
            }
          },
          {
            key: '_clearGroupSystemNotice',
            value: function() {
              var e = this
              this.getPendencyList().then(function(t) {
                t.forEach(function(t) {
                  e.pendencyMap.set(
                    ''
                      .concat(t.from, '_')
                      .concat(t.groupID, '_')
                      .concat(t.to),
                    t
                  )
                })
                var n = e.tim.messageController.getLocalMessageList(an.CONV_SYSTEM),
                  r = []
                n.forEach(function(t) {
                  var n = t.payload,
                    o = n.operatorID,
                    i = n.operationType,
                    a = n.groupProfile
                  if (i === Ml) {
                    var s = ''
                        .concat(o, '_')
                        .concat(a.groupID, '_')
                        .concat(a.to),
                      u = e.pendencyMap.get(s)
                    u && xs(u.handled) && 0 !== u.handled && r.push(t)
                  }
                }),
                  e.groupController.deleteGroupSystemNotice({ messageList: r })
              })
            }
          },
          {
            key: 'getPendencyList',
            value: function(e) {
              var t = this,
                n = this.groupController.createPackage({
                  name: 'group',
                  action: 'getGroupPendency',
                  param: {
                    startTime: e && e.startTime ? e.startTime : 0,
                    limit: e && e.limit ? e.limit : 10,
                    handleAccount: this.tim.context.identifier
                  }
                })
              return this.groupController.connectionController.request(n).then(function(e) {
                var n = e.data,
                  r = n.pendencyList
                return 0 !== n.nextStartTime
                  ? t.getPendencyList({ startTime: n.nextStartTime }).then(function(e) {
                      return [].concat(bn(r), bn(e))
                    })
                  : r
              })
            }
          },
          {
            key: '_onReceivedGroupSystemNotice',
            value: function(e) {
              var t = this,
                n = e.data,
                r = n.result
              'sync' !== n.type &&
                r.forEach(function(e) {
                  switch (e.payload.operationType) {
                    case 1:
                      t._onApplyGroupRequest(e)
                      break
                    case 2:
                      t._onApplyGroupRequestAgreed(e)
                      break
                    case 3:
                      t._onApplyGroupRequestRefused(e)
                      break
                    case 4:
                      t._onMemberKicked(e)
                      break
                    case 5:
                      t._onGroupDismissed(e)
                      break
                    case 6:
                      break
                    case 7:
                      t._onInviteGroup(e)
                      break
                    case 8:
                      t._onQuitGroup(e)
                      break
                    case 9:
                      t._onSetManager(e)
                      break
                    case 10:
                      t._onDeleteManager(e)
                      break
                    case 11:
                    case 12:
                    case 15:
                      break
                    case 255:
                      t.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                        message: e,
                        type: wl
                      })
                  }
                })
            }
          },
          {
            key: '_onApplyGroupRequest',
            value: function(e) {
              this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, { message: e, type: Ml })
            }
          },
          {
            key: '_onApplyGroupRequestAgreed',
            value: function(e) {
              var t = this,
                n = e.payload.groupProfile.groupID
              this.groupController.hasLocalGroup(n) ||
                this.groupController.getGroupProfile({ groupID: n }).then(function(e) {
                  var n = e.data.group
                  n &&
                    (t.groupController.updateGroupMap([n]), t.groupController.emitGroupListUpdate())
                }),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Ol
                })
            }
          },
          {
            key: '_onApplyGroupRequestRefused',
            value: function(e) {
              this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, { message: e, type: Al })
            }
          },
          {
            key: '_onMemberKicked',
            value: function(e) {
              var t = e.payload.groupProfile.groupID
              this.groupController.hasLocalGroup(t) &&
                this.groupController.deleteLocalGroupAndConversation(t),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Dl
                })
            }
          },
          {
            key: '_onGroupDismissed',
            value: function(e) {
              var t = e.payload.groupProfile.groupID,
                n = this.groupController.hasLocalGroup(t),
                r = this.groupController.AVChatRoomHandler
              n && this.groupController.deleteLocalGroupAndConversation(t),
                r.checkJoinedAVChatRoomByID(t) && r.reset(),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Nl
                })
            }
          },
          {
            key: '_onInviteGroup',
            value: function(e) {
              var t = this,
                n = e.payload.groupProfile.groupID
              this.groupController.hasLocalGroup(n) ||
                this.groupController.getGroupProfile({ groupID: n }).then(function(e) {
                  var n = e.data.group
                  n &&
                    (t.groupController.updateGroupMap([n]), t.groupController.emitGroupListUpdate())
                }),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Rl
                })
            }
          },
          {
            key: '_onQuitGroup',
            value: function(e) {
              var t = e.payload.groupProfile.groupID
              this.groupController.hasLocalGroup(t) &&
                this.groupController.deleteLocalGroupAndConversation(t),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Ll
                })
            }
          },
          {
            key: '_onSetManager',
            value: function(e) {
              var t = e.payload.groupProfile,
                n = t.to,
                r = t.groupID,
                o = this.groupController.getLocalGroupMemberInfo(r, n)
              o && o.updateRole(an.GRP_MBR_ROLE_ADMIN),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: Pl
                })
            }
          },
          {
            key: '_onDeleteManager',
            value: function(e) {
              var t = e.payload.groupProfile,
                n = t.to,
                r = t.groupID,
                o = this.groupController.getLocalGroupMemberInfo(r, n)
              o && o.updateRole(an.GRP_MBR_ROLE_MEMBER),
                this.tim.outerEmitter.emit(on.GROUP_SYSTEM_NOTICE_RECEIVED, {
                  message: e,
                  type: kl
                })
            }
          },
          {
            key: 'reset',
            value: function() {
              this.pendencyMap.clear()
            }
          }
        ]),
        e
      )
    })(),
    jg = { 3: !0, 4: !0, 5: !0, 6: !0 },
    Yg = (function() {
      function e(t) {
        var n = t.tim,
          r = t.groupController
        In(this, e),
          (this.tim = n),
          (this.groupController = r),
          (this.AVChatRoomLoop = null),
          (this.key = ''),
          (this.startSeq = 0),
          (this.group = {})
      }
      return (
        Tn(e, [
          {
            key: 'hasJoinedAVChatRoom',
            value: function() {
              return !(!this.group || Bs(this.group.groupID))
            }
          },
          {
            key: 'checkJoinedAVChatRoomByID',
            value: function(e) {
              return !(!this.group && Bs(this.group.groupID)) && e === this.group.groupID
            }
          },
          {
            key: 'getJoinedAVChatRoom',
            value: function() {
              return this.hasJoinedAVChatRoom() ? this.group : null
            }
          },
          {
            key: '_updateProperties',
            value: function(e) {
              var t = this
              Object.keys(e).forEach(function(n) {
                t[n] = e[n]
              })
            }
          },
          {
            key: 'start',
            value: function() {
              var e = { key: this.key, startSeq: this.startSeq }
              if (null === this.AVChatRoomLoop) {
                var t = this.tim.notificationController.createPackage({
                  name: 'AVChatRoom',
                  action: 'startLongPoll',
                  param: e
                })
                ;(this.AVChatRoomLoop = this.tim.connectionController.createRunLoop({
                  pack: t,
                  before: this._updateRequestData.bind(this),
                  success: this._handleSuccess.bind(this),
                  fail: this._handleFailure.bind(this)
                })),
                  this.AVChatRoomLoop.start(),
                  Gs.log('AVChatRoomHandler.start message channel started')
              } else this.AVChatRoomLoop.isRunning() || this.AVChatRoomLoop.start()
            }
          },
          {
            key: 'stop',
            value: function() {
              null !== this.AVChatRoomLoop &&
                this.AVChatRoomLoop.isRunning() &&
                (this.AVChatRoomLoop.abort(),
                this.AVChatRoomLoop.stop(),
                Gs.log('AVChatRoomHandler.stop message channel stopped'))
            }
          },
          {
            key: 'startRunLoop',
            value: function(e) {
              var t = this
              return this._precheck().then(function() {
                var n = e.longPollingKey,
                  r = e.group
                return (
                  t._updateProperties({ key: n, startSeq: 0, group: r || {} }),
                  t.groupController.updateGroupMap([r]),
                  t.groupController.emitGroupListUpdate(!0, !1),
                  t.start(),
                  t.groupController.isLoggedIn()
                    ? Vp({ status: _u.SUCCESS, group: r })
                    : Vp({ status: _u.SUCCESS })
                )
              })
            }
          },
          {
            key: 'joinWithoutAuth',
            value: function(e) {
              var t = this,
                n = this.groupController.createPackage({
                  name: 'group',
                  action: 'applyJoinAVChatRoom',
                  param: e
                })
              return this.tim.connectionController
                .request(n)
                .then(function(n) {
                  var r = n.data.longPollingKey
                  if (Bs(r))
                    return Kp(
                      new np({
                        code: rp.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN,
                        message: op.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN
                      })
                    )
                  Gs.log('AVChatRoomHandler.joinWithoutAuth ok. groupID:', e.groupID),
                    t.tim.innerEmitter.emit(Sp.AVCHATROOM_JOIN_SUCCESS, { data: e.groupID })
                  var o = new Tg({ groupID: e.groupID })
                  return (
                    t.startRunLoop({ group: o, longPollingKey: r }), new xp({ status: _u.SUCCESS })
                  )
                })
                .catch(function(t) {
                  return (
                    Gs.error(
                      'AVChatRoomHandler.joinWithoutAuth error:'
                        .concat(t.message, '. groupID:')
                        .concat(e.groupID)
                    ),
                    Kp(t)
                  )
                })
            }
          },
          {
            key: '_precheck',
            value: function() {
              if (!this.hasJoinedAVChatRoom()) return Promise.resolve()
              if (this.groupController.isLoggedIn()) {
                if (
                  !(
                    this.group.selfInfo.role === an.GRP_MBR_ROLE_OWNER ||
                    this.group.ownerID === this.tim.loginInfo.identifier
                  )
                )
                  return this.groupController.quitGroup(this.group.groupID)
                this.groupController.deleteLocalGroupAndConversation(this.group.groupID)
              } else this.groupController.deleteLocalGroupAndConversation(this.group.groupID)
              return this.reset(), Promise.resolve()
            }
          },
          {
            key: '_updateRequestData',
            value: function(e) {
              ;(e.StartSeq = this.startSeq),
                (e.Key = this.key),
                this.tim.sumStatController.addTotalCount(Bp.LONG_POLLING_AV)
            }
          },
          {
            key: '_handleSuccess',
            value: function(e) {
              this.tim.sumStatController.addSuccessCount(Bp.LONG_POLLING_AV),
                this.tim.sumStatController.addCost(Bp.LONG_POLLING_AV, e.data.timecost),
                (this.startSeq = e.data.nextSeq),
                (this.key = e.data.key),
                Array.isArray(e.data.rspMsgList) &&
                  e.data.rspMsgList.forEach(function(e) {
                    e.to = e.groupID
                  }),
                e.data.rspMsgList &&
                  e.data.rspMsgList.length > 0 &&
                  this._dispatchNotice(e.data.rspMsgList)
            }
          },
          {
            key: '_handleFailure',
            value: function(e) {
              if (e.error) {
                var t = new Hp()
                t.setMethod(jp.LONG_POLLING_AV_ERROR).setStart(),
                  this.groupController.probeNetwork(function(n, r) {
                    t.setError(e.error, n, r).setEnd()
                  }),
                  this.tim.innerEmitter.emit(Sp.ERROR_DETECTED, e.error)
              }
            }
          },
          {
            key: '_dispatchNotice',
            value: function(e) {
              if (Ks(e) && 0 !== e.length) {
                for (var t = null, n = [], r = [], o = 0; o < e.length; o++)
                  jg[e[o].event]
                    ? ((t = this.packMessage(e[o], e[o].event)),
                      this.tim.messageController.hasLocalMessage(t.conversationID, t.ID) ||
                        (t.conversationType === an.CONV_SYSTEM && r.push(t), n.push(t)))
                    : Gs.warn(
                        'AVChatRoomHandler._dispatchMessage 未处理的 event 类型：',
                        e[o].event
                      )
                if (
                  (r.length > 0 &&
                    this.tim.innerEmitter.emit(Sp.MESSAGE_GROUP_SYSTEM_NOTICE_RECEIVED, {
                      data: { result: r, eventDataList: [], type: 'poll' }
                    }),
                  0 !== n.length)
                ) {
                  var i = this.packConversationOption(n)
                  i.length > 0 &&
                    this.tim.innerEmitter.emit(Sp.MESSAGE_GROUP_INSTANT_RECEIVED, {
                      data: { eventDataList: i, type: 'poll' }
                    }),
                    Gs.debug('AVChatRoomHandler._dispatchNotice nums='.concat(n.length)),
                    this.tim.outerEmitter.emit(on.MESSAGE_RECEIVED, n)
                }
              }
            }
          },
          {
            key: 'packMessage',
            value: function(e, t) {
              ;(e.currentUser = this.tim.context.identifier),
                (e.conversationType = 5 === t ? an.CONV_SYSTEM : an.CONV_GROUP),
                (e.isSystemMessage = !!e.isSystemMessage)
              var n = new pp(e),
                r = this.packElements(e, t)
              return n.setElement(r), n
            }
          },
          {
            key: 'packElements',
            value: function(e, t) {
              return 4 === t || 6 === t
                ? {
                    type: an.MSG_GRP_TIP,
                    content: An({}, e.elements, { groupProfile: e.groupProfile })
                  }
                : 5 === t
                ? {
                    type: an.MSG_GRP_SYS_NOTICE,
                    content: An({}, e.elements, { groupProfile: e.groupProfile })
                  }
                : this.tim.bigDataHallwayController.parseElements(e.elements, e.from)
            }
          },
          {
            key: 'packConversationOption',
            value: function(e) {
              for (var t = new Map(), n = 0; n < e.length; n++) {
                var r = e[n],
                  o = r.conversationID
                if (t.has(o)) {
                  var i = t.get(o)
                  ;(i.lastMessage = r), 'in' === r.flow && i.unreadCount++
                } else
                  t.set(o, {
                    conversationID: r.conversationID,
                    unreadCount: 'out' === r.flow ? 0 : 1,
                    type: r.conversationType,
                    subType: r.conversationSubType,
                    lastMessage: r
                  })
              }
              return bn(t.values())
            }
          },
          {
            key: 'reset',
            value: function() {
              null !== this.AVChatRoomLoop &&
                (Gs.log('AVChatRoomHandler.reset'),
                this.stop(),
                (this.AVChatRoomLoop = null),
                (this.key = ''),
                (this.startSeq = 0),
                (this.group = {}))
            }
          }
        ]),
        e
      )
    })(),
    $g = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).groupMap = new Map()),
          (n.groupMemberListMap = new Map()),
          (n.groupNoticeHandler = new Hg({ tim: e, groupController: kn(n) })),
          (n.groupTipsHandler = new Bg({ tim: e, groupController: kn(n) })),
          (n.AVChatRoomHandler = new Yg({ tim: e, groupController: kn(n) })),
          n._initListeners(),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'createGroup',
            value: function(e) {
              var t = this
              if (!['Public', 'Private', 'ChatRoom', 'AVChatRoom'].includes(e.type)) {
                var n = new np({ code: rp.ILLEGAL_GROUP_TYPE, message: op.ILLEGAL_GROUP_TYPE })
                return Kp(n)
              }
              lu(e.type) &&
                !Bs(e.memberList) &&
                e.memberList.length > 0 &&
                (Gs.warn(
                  'GroupController.createGroup 创建AVChatRoom时不能添加群成员，自动忽略该字段'
                ),
                (e.memberList = void 0)),
                cu(e.type) ||
                  Bs(e.joinOption) ||
                  (Gs.warn(
                    'GroupController.createGroup 创建Private/ChatRoom/AVChatRoom群时不能设置字段：joinOption，自动忽略该字段'
                  ),
                  (e.joinOption = void 0))
              var r = new Hp()
              r.setMethod(jp.CREATE_GROUP).setStart()
              var o = this.createPackage({ name: 'group', action: 'create', param: e })
              return (
                Gs.log('GroupController.createGroup.'),
                this.tim.connectionController
                  .request(o)
                  .then(function(n) {
                    if (
                      (r
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setText('groupType='.concat(e.type, ' groupID=').concat(n.data.groupID))
                        .setEnd(),
                      Gs.log('GroupController.createGroup ok. groupID:', n.data.groupID),
                      e.type === an.GRP_AVCHATROOM)
                    )
                      return t.getGroupProfile({ groupID: n.data.groupID })
                    t.updateGroupMap([An({}, e, { groupID: n.data.groupID })])
                    var o = t.tim.createCustomMessage({
                      to: n.data.groupID,
                      conversationType: an.CONV_GROUP,
                      payload: {
                        data: 'group_create',
                        extension: ''.concat(t.tim.context.identifier, '创建群组')
                      }
                    })
                    return (
                      t.tim.sendMessage(o),
                      t.emitGroupListUpdate(),
                      t.getGroupProfile({ groupID: n.data.groupID })
                    )
                  })
                  .then(function(e) {
                    var t = e.data.group
                    return (
                      (t.selfInfo.messageRemindType = an.MSG_REMIND_ACPT_AND_NOTE),
                      (t.selfInfo.role = an.GRP_MBR_ROLE_OWNER),
                      e
                    )
                  })
                  .catch(function(n) {
                    return (
                      r.setText('groupType='.concat(e.type)),
                      t.probeNetwork().then(function(e, t) {
                        r.setError(n, e, t).setEnd()
                      }),
                      Gs.error('GroupController.createGroup error:', n),
                      Kp(n)
                    )
                  })
              )
            }
          },
          {
            key: 'joinGroup',
            value: function(e) {
              if (this.hasLocalGroup(e.groupID)) {
                var t = { status: an.JOIN_STATUS_ALREADY_IN_GROUP }
                return Vp(t)
              }
              if (e.type === an.GRP_PRIVATE) {
                var n = new np({ code: rp.CANNOT_JOIN_PRIVATE, message: op.CANNOT_JOIN_PRIVATE })
                return Kp(n)
              }
              return (
                Gs.log('GroupController.joinGroup. groupID:', e.groupID),
                this.isLoggedIn()
                  ? this.applyJoinGroup(e)
                  : this.AVChatRoomHandler.joinWithoutAuth(e)
              )
            }
          },
          {
            key: 'quitGroup',
            value: function(e) {
              var t = this
              Gs.log('GroupController.quitGroup. groupID:', e)
              var n = this.AVChatRoomHandler.checkJoinedAVChatRoomByID(e)
              if (n && !this.isLoggedIn())
                return (
                  Gs.log('GroupController.quitGroup anonymously ok. groupID:', e),
                  this.deleteLocalGroupAndConversation(e),
                  this.AVChatRoomHandler.reset(),
                  Vp({ groupID: e })
                )
              var r = new Hp()
              r.setMethod(jp.QUIT_GROUP).setStart()
              var o = this.createPackage({
                name: 'group',
                action: 'quitGroup',
                param: { groupID: e }
              })
              return this.tim.connectionController
                .request(o)
                .then(function() {
                  return (
                    r
                      .setCode(0)
                      .setNetworkType(t.getNetworkType())
                      .setText('groupID='.concat(e))
                      .setEnd(),
                    Gs.log('GroupController.quitGroup ok. groupID:', e),
                    n && t.AVChatRoomHandler.reset(),
                    t.deleteLocalGroupAndConversation(e),
                    new xp({ groupID: e })
                  )
                })
                .catch(function(n) {
                  return (
                    r.setText('groupID='.concat(e)),
                    t.probeNetwork().then(function(e, t) {
                      r.setError(n, e, t).setEnd()
                    }),
                    Gs.error(
                      'GroupController.quitGroup error.  error:'.concat(n, '. groupID:').concat(e)
                    ),
                    Kp(n)
                  )
                })
            }
          },
          {
            key: 'changeGroupOwner',
            value: function(e) {
              var t = this
              if (
                this.hasLocalGroup(e.groupID) &&
                this.getLocalGroupProfile(e.groupID).type === an.GRP_AVCHATROOM
              )
                return Kp(
                  new np({
                    code: rp.CANNOT_CHANGE_OWNER_IN_AVCHATROOM,
                    message: op.CANNOT_CHANGE_OWNER_IN_AVCHATROOM
                  })
                )
              if (e.newOwnerID === this.tim.loginInfo.identifier)
                return Kp(
                  new np({
                    code: rp.CANNOT_CHANGE_OWNER_TO_SELF,
                    message: op.CANNOT_CHANGE_OWNER_TO_SELF
                  })
                )
              var n = new Hp()
              n.setMethod(jp.CHANGE_GROUP_OWNER).setStart()
              var r = this.createPackage({ name: 'group', action: 'changeGroupOwner', param: e })
              return (
                Gs.log('GroupController.changeGroupOwner. groupID:', e.groupID),
                this.tim.connectionController
                  .request(r)
                  .then(function() {
                    n
                      .setCode(0)
                      .setNetworkType(t.getNetworkType())
                      .setText('groupID='.concat(e.groupID))
                      .setEnd(),
                      Gs.log('GroupController.changeGroupOwner ok. groupID:', e.groupID)
                    var r = e.groupID,
                      o = e.newOwnerID
                    t.groupMap.get(r).ownerID = o
                    var i = t.groupMemberListMap.get(r)
                    if (i instanceof Map) {
                      var a = i.get(t.tim.loginInfo.identifier)
                      Bs(a) ||
                        (a.updateRole('Member'), (t.groupMap.get(r).selfInfo.role = 'Member'))
                      var s = i.get(o)
                      Bs(s) || s.updateRole('Owner')
                    }
                    return t.emitGroupListUpdate(!0, !1), new xp({ group: t.groupMap.get(r) })
                  })
                  .catch(function(r) {
                    return (
                      n.setText('groupID='.concat(e.groupID)),
                      t.probeNetwork().then(function(e, t) {
                        n.setError(r, e, t).setEnd()
                      }),
                      Gs.error(
                        'GroupController.changeGroupOwner error:'
                          .concat(r, '. groupID:')
                          .concat(e.groupID)
                      ),
                      Kp(r)
                    )
                  })
              )
            }
          },
          {
            key: 'dismissGroup',
            value: function(e) {
              var t = this
              if (this.hasLocalGroup(e) && this.getLocalGroupProfile(e).type === an.GRP_PRIVATE)
                return Kp(
                  new np({ code: rp.CANNOT_DISMISS_PRIVATE, message: op.CANNOT_DISMISS_PRIVATE })
                )
              var n = new Hp()
              n.setMethod(jp.DISMISS_GROUP).setStart()
              var r = this.createPackage({
                name: 'group',
                action: 'destroyGroup',
                param: { groupID: e }
              })
              return (
                Gs.log('GroupController.dismissGroup. groupID:'.concat(e)),
                this.tim.connectionController
                  .request(r)
                  .then(function() {
                    return (
                      n
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setText('groupID='.concat(e))
                        .setEnd(),
                      Gs.log('GroupController.dismissGroup ok. groupID:'.concat(e)),
                      t.deleteLocalGroupAndConversation(e),
                      t.checkJoinedAVChatRoomByID(e) && t.AVChatRoomHandler.reset(),
                      new xp({ groupID: e })
                    )
                  })
                  .catch(function(r) {
                    return (
                      n.setText('groupID='.concat(e)),
                      t.probeNetwork().then(function(e, t) {
                        n.setError(r, e, t).setEnd()
                      }),
                      Gs.error(
                        'GroupController.dismissGroup error:'.concat(r, '. groupID:').concat(e)
                      ),
                      Kp(r)
                    )
                  })
              )
            }
          },
          {
            key: 'updateGroupProfile',
            value: function(e) {
              var t = this
              !this.hasLocalGroup(e.groupID) ||
                cu(this.getLocalGroupProfile(e.groupID).type) ||
                Bs(e.joinOption) ||
                (Gs.warn(
                  'GroupController.modifyGroup: Private/ChatRoom/AVChatRoom群不能设置字段：joinOption，自动忽略该字段'
                ),
                (e.joinOption = void 0))
              var n = new Hp()
              n.setMethod(jp.UPDATE_GROUP_PROFILE).setStart()
              var r = this.createPackage({ name: 'group', action: 'updateGroupProfile', param: e })
              return (
                Gs.log('GroupController.modifyGroup. groupID:', e.groupID),
                this.tim.connectionController
                  .request(r)
                  .then(function() {
                    ;(n
                      .setCode(0)
                      .setNetworkType(t.getNetworkType())
                      .setText('groupID='.concat(e.groupID))
                      .setEnd(),
                    Gs.log('GroupController.modifyGroup ok. groupID:', e.groupID),
                    t.hasLocalGroup(e.groupID)) &&
                      (t.groupMap.get(e.groupID).updateGroup(e), t._setStorageGroupList())
                    return new xp({ group: t.groupMap.get(e.groupID) })
                  })
                  .catch(function(r) {
                    return (
                      n.setText('groupID='.concat(e.groupID)),
                      t.probeNetwork().then(function(e, t) {
                        n.setError(r, e, t).setEnd()
                      }),
                      Gs.log(
                        'GroupController.modifyGroup error. error:'
                          .concat(r, ' groupID:')
                          .concat(e.groupID)
                      ),
                      Kp(r)
                    )
                  })
              )
            }
          },
          {
            key: 'setGroupMemberRole',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.userID,
                o = e.role,
                i = this.groupMap.get(n)
              if (i.selfInfo.role !== an.GRP_MBR_ROLE_OWNER)
                return Kp(new np({ code: rp.NOT_OWNER, message: op.NOT_OWNER }))
              if ([an.GRP_PRIVATE, an.GRP_AVCHATROOM].includes(i.type))
                return Kp(
                  new np({
                    code: rp.CANNOT_SET_MEMBER_ROLE_IN_PRIVATE_AND_AVCHATROOM,
                    message: op.CANNOT_SET_MEMBER_ROLE_IN_PRIVATE_AND_AVCHATROOM
                  })
                )
              if ([an.GRP_MBR_ROLE_ADMIN, an.GRP_MBR_ROLE_MEMBER].indexOf(o) < 0)
                return Kp(new np({ code: rp.INVALID_MEMBER_ROLE, message: op.INVALID_MEMBER_ROLE }))
              if (r === this.tim.loginInfo.identifier)
                return Kp(
                  new np({
                    code: rp.CANNOT_SET_SELF_MEMBER_ROLE,
                    message: op.CANNOT_SET_SELF_MEMBER_ROLE
                  })
                )
              var a = new Hp()
              return (
                a.setMethod(jp.SET_GROUPMEMBER_ROLE).setStart(),
                a.setText(
                  'groupID='
                    .concat(n, ' userID=')
                    .concat(r, ' role=')
                    .concat(o)
                ),
                Gs.log(
                  'GroupController.setGroupMemberRole. groupID:'.concat(n, '. userID: ').concat(r)
                ),
                this._modifyGroupMemberInfo({ groupID: n, userID: r, role: o })
                  .then(function(e) {
                    return (
                      a
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setEnd(),
                      Gs.log(
                        'GroupController.setGroupMemberRole ok. groupID:'
                          .concat(n, '. userID: ')
                          .concat(r)
                      ),
                      new xp({ group: i, member: e })
                    )
                  })
                  .catch(function(e) {
                    return (
                      t.probeNetwork().then(function(t, n) {
                        a.setError(e, t, n).setEnd()
                      }),
                      Gs.error(
                        'GroupController.setGroupMemberRole error:'
                          .concat(e, '. groupID:')
                          .concat(n, '. userID:')
                          .concat(r)
                      ),
                      Kp(e)
                    )
                  })
              )
            }
          },
          {
            key: 'setGroupMemberMuteTime',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.userID,
                o = e.muteTime
              if (r === this.tim.loginInfo.identifier)
                return Kp(new np({ code: rp.CANNOT_MUTE_SELF, message: op.CANNOT_MUTE_SELF }))
              Gs.log(
                'GroupController.setGroupMemberMuteTime. groupID:'.concat(n, '. userID: ').concat(r)
              )
              var i = new Hp()
              return (
                i.setMethod(jp.SET_GROUPMEMBER_MUTE_TIME).setStart(),
                i.setText(
                  'groupID='
                    .concat(n, ' userID=')
                    .concat(r, ' muteTime=')
                    .concat(o)
                ),
                this._modifyGroupMemberInfo({ groupID: n, userID: r, muteTime: o })
                  .then(function(e) {
                    return (
                      i
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setEnd(),
                      Gs.log(
                        'GroupController.setGroupMemberMuteTime ok. groupID:'
                          .concat(n, '. userID: ')
                          .concat(r)
                      ),
                      new xp({ group: t.getLocalGroupProfile(n), member: e })
                    )
                  })
                  .catch(function(e) {
                    return (
                      t.probeNetwork().then(function(t, n) {
                        i.setError(e, t, n).setEnd()
                      }),
                      Gs.error(
                        'GroupController.setGroupMemberMuteTime error:'
                          .concat(e, '. groupID:')
                          .concat(n, '. userID:')
                          .concat(r)
                      ),
                      Kp(e)
                    )
                  })
              )
            }
          },
          {
            key: 'setMessageRemindType',
            value: function(e) {
              var t = this
              Gs.log(
                'GroupController.setMessageRemindType. groupID:'
                  .concat(e.groupID, '. userID: ')
                  .concat(e.userID || this.tim.loginInfo.identifier)
              )
              var n = e.groupID,
                r = e.messageRemindType
              return this._modifyGroupMemberInfo({
                groupID: n,
                messageRemindType: r,
                userID: this.tim.loginInfo.identifier
              })
                .then(function() {
                  Gs.log(
                    'GroupController.setMessageRemindType ok. groupID:'
                      .concat(e.groupID, '. userID: ')
                      .concat(e.userID || t.tim.loginInfo.identifier)
                  )
                  var n = t.getLocalGroupProfile(e.groupID)
                  return n && (n.selfInfo.messageRemindType = r), new xp({ group: n })
                })
                .catch(function(n) {
                  return (
                    Gs.error(
                      'GroupController.setMessageRemindType error:'
                        .concat(n, '. groupID:')
                        .concat(e.groupID, '. userID:')
                        .concat(e.userID || t.tim.loginInfo.identifier)
                    ),
                    Kp(n)
                  )
                })
            }
          },
          {
            key: 'setGroupMemberNameCard',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.userID,
                o = void 0 === r ? this.tim.loginInfo.identifier : r,
                i = e.nameCard
              Gs.log(
                'GroupController.setGroupMemberNameCard. groupID:'.concat(n, '. userID: ').concat(o)
              )
              var a = new Hp()
              return (
                a.setMethod(jp.SET_GROUPMEMBER_NAME_CARD).setStart(),
                a.setText(
                  'groupID='
                    .concat(n, ' userID=')
                    .concat(o, ' nameCard=')
                    .concat(i)
                ),
                this._modifyGroupMemberInfo({ groupID: n, userID: o, nameCard: i })
                  .then(function(e) {
                    Gs.log(
                      'GroupController.setGroupMemberNameCard ok. groupID:'
                        .concat(n, '. userID: ')
                        .concat(o)
                    ),
                      a
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setEnd()
                    var r = t.getLocalGroupProfile(n)
                    return (
                      o === t.tim.loginInfo.identifier && r && r.setSelfNameCard(i),
                      new xp({ group: r, member: e })
                    )
                  })
                  .catch(function(e) {
                    return (
                      t.probeNetwork().then(function(t, n) {
                        a.setError(e, t, n).setEnd()
                      }),
                      Gs.error(
                        'GroupController.setGroupMemberNameCard error:'
                          .concat(e, '. groupID:')
                          .concat(n, '. userID:')
                          .concat(o)
                      ),
                      Kp(e)
                    )
                  })
              )
            }
          },
          {
            key: 'setGroupMemberCustomField',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.userID,
                o = void 0 === r ? this.tim.loginInfo.identifier : r,
                i = e.memberCustomField
              Gs.log(
                'GroupController.setGroupMemberCustomField. groupID:'
                  .concat(n, '. userID: ')
                  .concat(o)
              )
              var a = new Hp()
              return (
                a.setMethod(jp.SET_GROUPMEMBER_CUSTOM_FIELD).setStart(),
                a.setText(
                  'groupID='
                    .concat(n, ' userID=')
                    .concat(o, ' memberCustomField=')
                    .concat(i)
                ),
                this._modifyGroupMemberInfo({ groupID: n, userID: o, memberCustomField: i })
                  .then(function(e) {
                    return (
                      a
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setEnd(),
                      Gs.log(
                        'GroupController.setGroupMemberCustomField ok. groupID:'
                          .concat(n, '. userID: ')
                          .concat(o)
                      ),
                      new xp({ group: t.groupMap.get(n), member: e })
                    )
                  })
                  .catch(function(e) {
                    return (
                      t.probeNetwork().then(function(t, n) {
                        a.setError(e, t, n).setEnd()
                      }),
                      Gs.error(
                        'GroupController.setGroupMemberCustomField error:'
                          .concat(e, '. groupID:')
                          .concat(n, '. userID:')
                          .concat(o)
                      ),
                      Kp(e)
                    )
                  })
              )
            }
          },
          {
            key: 'getGroupList',
            value: function(e) {
              var t = this,
                n = new Hp()
              n.setMethod(jp.GET_GROUP_LIST).setStart(), Gs.log('GroupController.getGroupList')
              var r = {
                  introduction: 'Introduction',
                  notification: 'Notification',
                  createTime: 'CreateTime',
                  ownerID: 'Owner_Account',
                  lastInfoTime: 'LastInfoTime',
                  memberNum: 'MemberNum',
                  maxMemberNum: 'MaxMemberNum',
                  joinOption: 'ApplyJoinOption'
                },
                o = ['Type', 'Name', 'FaceUrl', 'NextMsgSeq', 'LastMsgTime']
              e &&
                e.groupProfileFilter &&
                e.groupProfileFilter.forEach(function(e) {
                  r[e] && o.push(r[e])
                })
              var i = this.createPackage({
                name: 'group',
                action: 'list',
                param: {
                  responseFilter: {
                    groupBaseInfoFilter: o,
                    selfInfoFilter: ['Role', 'JoinTime', 'MsgFlag']
                  }
                }
              })
              return this.tim.connectionController
                .request(i)
                .then(function(e) {
                  var r = e.data.groups
                  return (
                    n
                      .setCode(0)
                      .setNetworkType(t.getNetworkType())
                      .setText(r.length)
                      .setEnd(),
                    Gs.log('GroupController.getGroupList ok'),
                    t._groupListTreeShaking(r),
                    t.updateGroupMap(r),
                    t.tempConversationList &&
                      (t._handleUpdateGroupLastMessage(t.tempConversationList),
                      (t.tempConversationList = null)),
                    t.emitGroupListUpdate(),
                    new xp({ groupList: t.getLocalGroups() })
                  )
                })
                .catch(function(e) {
                  return (
                    t.probeNetwork().then(function(t, r) {
                      n.setError(e, t, r).setEnd()
                    }),
                    Gs.error('GroupController.getGroupList error: ', e),
                    Kp(e)
                  )
                })
            }
          },
          {
            key: 'getGroupMemberList',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.offset,
                o = void 0 === r ? 0 : r,
                i = e.count,
                a = void 0 === i ? 15 : i
              Gs.log(
                'GroupController.getGroupMemberList groupID: '
                  .concat(n, ' offset: ')
                  .concat(o, ' count: ')
                  .concat(a)
              )
              var s = this.createPackage({
                  name: 'group',
                  action: 'getGroupMemberList',
                  param: {
                    groupID: n,
                    offset: o,
                    limit: a > 100 ? 100 : a,
                    memberInfoFilter: ['Role', 'NameCard']
                  }
                }),
                u = []
              return this.connectionController
                .request(s)
                .then(function(e) {
                  var r = e.data,
                    o = r.members,
                    i = r.memberNum
                  return Ks(o) && 0 !== o.length
                    ? (t.hasLocalGroup(n) && (t.getLocalGroupProfile(n).memberNum = i),
                      (u = t._updateLocalGroupMemberMap(n, o)),
                      t.tim.getUserProfile({
                        userIDList: o.map(function(e) {
                          return e.userID
                        }),
                        tagList: [Fl.NICK, Fl.AVATAR]
                      }))
                    : Promise.resolve([])
                })
                .then(function(e) {
                  var r = e.data
                  if (!Ks(r) || 0 === r.length) return Vp({ memberList: [] })
                  var o = r.map(function(e) {
                    return { userID: e.userID, nick: e.nick, avatar: e.avatar }
                  })
                  return (
                    t._updateLocalGroupMemberMap(n, o),
                    Gs.log('GroupController.getGroupMemberList ok.'),
                    new xp({ memberList: u })
                  )
                })
                .catch(function(e) {
                  return Gs.error('GroupController.getGroupMemberList error: ', e), Kp(e)
                })
            }
          },
          {
            key: 'getLocalGroups',
            value: function() {
              return bn(this.groupMap.values())
            }
          },
          {
            key: 'getLocalGroupProfile',
            value: function(e) {
              return this.groupMap.get(e)
            }
          },
          {
            key: 'hasLocalGroup',
            value: function(e) {
              return this.groupMap.has(e)
            }
          },
          {
            key: 'getLocalGroupMemberInfo',
            value: function(e, t) {
              return this.groupMemberListMap.has(e) ? this.groupMemberListMap.get(e).get(t) : null
            }
          },
          {
            key: 'setLocalGroupMember',
            value: function(e, t) {
              if (this.groupMemberListMap.has(e)) this.groupMemberListMap.get(e).set(t.userID, t)
              else {
                var n = new Map().set(t.userID, t)
                this.groupMemberListMap.set(e, n)
              }
            }
          },
          {
            key: 'hasLocalGroupMember',
            value: function(e, t) {
              return this.groupMemberListMap.has(e) && this.groupMemberListMap.get(e).has(t)
            }
          },
          {
            key: 'hasLocalGroupMemberMap',
            value: function(e) {
              return this.groupMemberListMap.has(e)
            }
          },
          {
            key: 'getGroupProfile',
            value: function(e) {
              var t = this
              Gs.log('GroupController.getGroupProfile. groupID:', e.groupID)
              var n = e.groupID,
                r = e.groupCustomFieldFilter,
                o = {
                  groupIDList: [n],
                  responseFilter: {
                    groupBaseInfoFilter: [
                      'Type',
                      'Name',
                      'Introduction',
                      'Notification',
                      'FaceUrl',
                      'Owner_Account',
                      'CreateTime',
                      'InfoSeq',
                      'LastInfoTime',
                      'LastMsgTime',
                      'MemberNum',
                      'MaxMemberNum',
                      'ApplyJoinOption',
                      'NextMsgSeq'
                    ],
                    groupCustomFieldFilter: r
                  }
                }
              return this.getGroupProfileAdvance(o)
                .then(function(r) {
                  var o,
                    i = r.data,
                    a = i.successGroupList,
                    s = i.failureGroupList
                  return (
                    Gs.log('GroupController.getGroupProfile ok. groupID:', e.groupID),
                    s.length > 0
                      ? Kp(s[0])
                      : (lu(a[0].type) && !t.hasLocalGroup(n)
                          ? (o = new Tg(a[0]))
                          : (t.updateGroupMap(a), (o = t.getLocalGroupProfile(n))),
                        o && o.selfInfo && !o.selfInfo.nameCard
                          ? t.updateSelfInfo(o).then(function(e) {
                              return new xp({ group: e })
                            })
                          : new xp({ group: o }))
                  )
                })
                .catch(function(t) {
                  return (
                    Gs.error(
                      'GroupController.getGroupProfile error:'
                        .concat(t, '. groupID:')
                        .concat(e.groupID)
                    ),
                    Kp(t)
                  )
                })
            }
          },
          {
            key: 'getGroupMemberProfile',
            value: function(e) {
              var t = this
              Gs.log(
                'GroupController.getGroupMemberProfile groupID:'
                  .concat(e.groupID, ' userIDList:')
                  .concat(e.userIDList.join(','))
              ),
                e.userIDList.length > 50 && (e.userIDList = e.userIDList.slice(0, 50))
              var n = e.groupID,
                r = e.userIDList
              return this._getGroupMemberProfileAdvance(An({}, e, { userIDList: r }))
                .then(function(e) {
                  var r = e.data.members
                  return Ks(r) && 0 !== r.length
                    ? (t._updateLocalGroupMemberMap(n, r),
                      t.tim.getUserProfile({
                        userIDList: r.map(function(e) {
                          return e.userID
                        }),
                        tagList: [Fl.NICK, Fl.AVATAR]
                      }))
                    : Vp([])
                })
                .then(function(e) {
                  var o = e.data.map(function(e) {
                    return { userID: e.userID, nick: e.nick, avatar: e.avatar }
                  })
                  t._updateLocalGroupMemberMap(n, o)
                  var i = r
                    .filter(function(e) {
                      return t.hasLocalGroupMember(n, e)
                    })
                    .map(function(e) {
                      return t.getLocalGroupMemberInfo(n, e)
                    })
                  return new xp({ memberList: i })
                })
            }
          },
          {
            key: '_getGroupMemberProfileAdvance',
            value: function(e) {
              var t = this.createPackage({
                name: 'group',
                action: 'getGroupMemberProfile',
                param: An({}, e, {
                  memberInfoFilter: e.memberInfoFilter
                    ? e.memberInfoFilter
                    : ['Role', 'JoinTime', 'NameCard', 'ShutUpUntil']
                })
              })
              return this.connectionController.request(t)
            }
          },
          {
            key: 'updateSelfInfo',
            value: function(e) {
              var t = e.groupID
              Gs.log('GroupController.updateSelfInfo groupID:', t)
              var n = { groupID: t, userIDList: [this.tim.loginInfo.identifier] }
              return this.getGroupMemberProfile(n).then(function(n) {
                var r = n.data.memberList
                return (
                  Gs.log('GroupController.updateSelfInfo ok. groupID:', t),
                  e && 0 !== r.length && e.updateSelfInfo(r[0]),
                  e
                )
              })
            }
          },
          {
            key: 'addGroupMember',
            value: function(e) {
              var t = this.getLocalGroupProfile(e.groupID)
              if (lu(t.type)) {
                var n = new np({
                  code: rp.CANNOT_ADD_MEMBER_IN_AVCHATROOM,
                  message: op.CANNOT_ADD_MEMBER_IN_AVCHATROOM
                })
                return Kp(n)
              }
              e.userIDList = e.userIDList.map(function(e) {
                return { userID: e }
              })
              var r = this.createPackage({ name: 'group', action: 'addGroupMember', param: e })
              return (
                Gs.log('GroupController.addGroupMember. groupID:', e.groupID),
                this.connectionController
                  .request(r)
                  .then(function(n) {
                    var r = n.data.members
                    Gs.log('GroupController.addGroupMember ok. groupID:', e.groupID)
                    var o = r
                        .filter(function(e) {
                          return 1 === e.result
                        })
                        .map(function(e) {
                          return e.userID
                        }),
                      i = r
                        .filter(function(e) {
                          return 0 === e.result
                        })
                        .map(function(e) {
                          return e.userID
                        }),
                      a = r
                        .filter(function(e) {
                          return 2 === e.result
                        })
                        .map(function(e) {
                          return e.userID
                        })
                    return 0 === o.length
                      ? new xp({ successUserIDList: o, failureUserIDList: i, existedUserIDList: a })
                      : ((t.memberNum += o.length),
                        new xp({
                          successUserIDList: o,
                          failureUserIDList: i,
                          existedUserIDList: a,
                          group: t
                        }))
                  })
                  .catch(function(t) {
                    return (
                      Gs.error(
                        'GroupController.addGroupMember error:'
                          .concat(t, ', groupID:')
                          .concat(e.groupID)
                      ),
                      Kp(t)
                    )
                  })
              )
            }
          },
          {
            key: 'deleteGroupMember',
            value: function(e) {
              var t = this
              Gs.log(
                'GroupController.deleteGroupMember groupID:'
                  .concat(e.groupID, ' userIDList:')
                  .concat(e.userIDList)
              )
              var n = this.getLocalGroupProfile(e.groupID)
              if (n.type === an.GRP_AVCHATROOM)
                return Kp(
                  new np({
                    code: rp.CANNOT_KICK_MEMBER_IN_AVCHATROOM,
                    message: op.CANNOT_KICK_MEMBER_IN_AVCHATROOM
                  })
                )
              var r = this.createPackage({ name: 'group', action: 'deleteGroupMember', param: e })
              return this.connectionController
                .request(r)
                .then(function() {
                  return (
                    Gs.log('GroupController.deleteGroupMember ok'),
                    n.memberNum--,
                    t.deleteLocalGroupMembers(e.groupID, e.userIDList),
                    new xp({ group: n, userIDList: e.userIDList })
                  )
                })
                .catch(function(t) {
                  return (
                    Gs.error(
                      'GroupController.deleteGroupMember error:'
                        .concat(t.code, ', groupID:')
                        .concat(e.groupID)
                    ),
                    Kp(t)
                  )
                })
            }
          },
          {
            key: 'searchGroupByID',
            value: function(e) {
              var t = { groupIDList: [e] },
                n = this.createPackage({ name: 'group', action: 'searchGroupByID', param: t })
              return (
                Gs.log('GroupController.searchGroupByID. groupID:'.concat(e)),
                this.connectionController
                  .request(n)
                  .then(function(t) {
                    var n = t.data.groupProfile
                    if (
                      (Gs.log('GroupController.searchGroupByID ok. groupID:'.concat(e)),
                      n[0].errorCode !== yu.REQUEST.SUCCESS)
                    )
                      throw new np({ code: n[0].errorCode, message: n[0].errorInfo })
                    return new xp({ group: new Tg(n[0]) })
                  })
                  .catch(function(t) {
                    return (
                      Gs.error(
                        'GroupController.searchGroupByID error:'.concat(t, ', groupID:').concat(e)
                      ),
                      Kp(t)
                    )
                  })
              )
            }
          },
          {
            key: 'applyJoinGroup',
            value: function(e) {
              var t = this,
                n = new Hp()
              n.setMethod(jp.APPLY_JOIN_GROUP).setStart()
              var r = this.createPackage({ name: 'group', action: 'applyJoinGroup', param: e })
              return this.connectionController
                .request(r)
                .then(function(r) {
                  var o = r.data,
                    i = o.joinedStatus,
                    a = o.longPollingKey
                  switch (
                    (n
                      .setCode(0)
                      .setNetworkType(t.getNetworkType())
                      .setText('groupID='.concat(e.groupID, ' joinedStatus=').concat(i))
                      .setEnd(),
                    Gs.log('GroupController.joinGroup ok. groupID:', e.groupID),
                    i)
                  ) {
                    case _u.WAIT_APPROVAL:
                      return new xp({ status: _u.WAIT_APPROVAL })
                    case _u.SUCCESS:
                      return t.getGroupProfile({ groupID: e.groupID }).then(function(n) {
                        var r = n.data.group,
                          o = { status: _u.SUCCESS, group: r }
                        return Bs(a)
                          ? new xp(o)
                          : (t.tim.innerEmitter.emit(Sp.AVCHATROOM_JOIN_SUCCESS, {
                              data: e.groupID
                            }),
                            t.AVChatRoomHandler.startRunLoop({ longPollingKey: a, group: r }))
                      })
                    default:
                      var s = new np({ code: rp.JOIN_GROUP_FAIL, message: op.JOIN_GROUP_FAIL })
                      return (
                        Gs.error(
                          'GroupController.joinGroup error:'
                            .concat(s, '. groupID:')
                            .concat(e.groupID)
                        ),
                        Kp(s)
                      )
                  }
                })
                .catch(function(r) {
                  return (
                    n.setText('groupID='.concat(e.groupID)),
                    t.probeNetwork().then(function(e, t) {
                      n.setError(r, e, t).setEnd()
                    }),
                    Gs.error(
                      'GroupController.joinGroup error:'.concat(r, '. groupID:').concat(e.groupID)
                    ),
                    Kp(r)
                  )
                })
            }
          },
          {
            key: 'applyJoinAVChatRoom',
            value: function(e) {
              return this.AVChatRoomHandler.applyJoinAVChatRoom(e)
            }
          },
          {
            key: 'handleGroupApplication',
            value: function(e) {
              var t = this,
                n = e.message.payload,
                r = n.groupProfile.groupID,
                o = n.authentication,
                i = n.messageKey,
                a = n.operatorID,
                s = this.createPackage({
                  name: 'group',
                  action: 'handleApplyJoinGroup',
                  param: An({}, e, { applicant: a, groupID: r, authentication: o, messageKey: i })
                })
              return (
                Gs.log('GroupController.handleApplication. groupID:', r),
                this.connectionController
                  .request(s)
                  .then(function() {
                    return (
                      Gs.log('GroupController.handleApplication ok. groupID:', r),
                      t.deleteGroupSystemNotice({ messageList: [e.message] }),
                      new xp({ group: t.getLocalGroupProfile(r) })
                    )
                  })
                  .catch(function(e) {
                    return (
                      Gs.error(
                        'GroupController.handleApplication error.  error:'
                          .concat(e, '. groupID:')
                          .concat(r)
                      ),
                      Kp(e)
                    )
                  })
              )
            }
          },
          {
            key: 'deleteGroupSystemNotice',
            value: function(e) {
              var t = this
              if (!Ks(e.messageList) || 0 === e.messageList.length) return Vp()
              Gs.log(
                'GroupController.deleteGroupSystemNotice ' +
                  e.messageList.map(function(e) {
                    return e.ID
                  })
              )
              var n = this.createPackage({
                name: 'group',
                action: 'deleteGroupSystemNotice',
                param: {
                  messageListToDelete: e.messageList.map(function(e) {
                    return {
                      from: an.CONV_SYSTEM,
                      messageSeq: e.clientSequence,
                      messageRandom: e.random
                    }
                  })
                }
              })
              return this.connectionController
                .request(n)
                .then(function() {
                  return (
                    Gs.log('GroupController.deleteGroupSystemNotice ok'),
                    e.messageList.forEach(function(e) {
                      t.tim.messageController.deleteLocalMessage(e)
                    }),
                    new xp()
                  )
                })
                .catch(function(e) {
                  return Gs.error('GroupController.deleteGroupSystemNotice error:', e), Kp(e)
                })
            }
          },
          {
            key: 'getLocalGroupLastSequence',
            value: function(e) {
              if (!this.groupMap.has(e)) return 0
              var t = this.groupMap.get(e)
              return t.lastMessage.lastSequence ? t.lastMessage.lastSequence : t.nextMessageSeq - 1
            }
          },
          {
            key: 'getGroupProfileAdvance',
            value: function(e) {
              Ks(e.groupIDList) &&
                e.groupIDList.length > 50 &&
                (Gs.warn('GroupController.getGroupProfileAdvance 获取群资料的数量不能超过50个'),
                (e.groupIDList.length = 50)),
                Gs.log('GroupController.getGroupProfileAdvance. groupIDList:', e.groupIDList)
              var t = this.createPackage({ name: 'group', action: 'query', param: e })
              return this.tim.connectionController
                .request(t)
                .then(function(e) {
                  Gs.log('GroupController.getGroupProfileAdvance ok.')
                  var t = e.data.groups,
                    n = t.filter(function(e) {
                      return Bs(e.errorCode) || e.errorCode === yu.REQUEST.SUCCESS
                    }),
                    r = t
                      .filter(function(e) {
                        return e.errorCode && e.errorCode !== yu.REQUEST.SUCCESS
                      })
                      .map(function(e) {
                        return new np({
                          code: Number('500'.concat(e.errorCode)),
                          message: e.errorInfo,
                          data: { groupID: e.groupID }
                        })
                      })
                  return new xp({ successGroupList: n, failureGroupList: r })
                })
                .catch(function(t) {
                  return (
                    Gs.error(
                      'GroupController.getGroupProfile error:'
                        .concat(t, '. groupID:')
                        .concat(e.groupID)
                    ),
                    Kp(t)
                  )
                })
            }
          },
          {
            key: '_deleteLocalGroup',
            value: function(e) {
              return (
                this.groupMap.delete(e),
                this.groupMemberListMap.delete(e),
                this._setStorageGroupList(),
                this.groupMap.has(e) && this.groupMemberListMap.has(e)
              )
            }
          },
          {
            key: '_initGroupList',
            value: function() {
              var e = this,
                t = new Hp()
              t.setMethod(jp.GET_GROUP_LIST_IN_STORAGE).setStart(),
                Gs.time(Bp.INIT_GROUP_LIST),
                Gs.log('GroupController._initGroupList')
              var n = this._getStorageGroupList()
              Ks(n) && n.length > 0
                ? (n.forEach(function(t) {
                    e.groupMap.set(t.groupID, new Tg(t))
                  }),
                  this.emitGroupListUpdate(!0, !1),
                  t
                    .setCode(0)
                    .setNetworkType(this.getNetworkType())
                    .setText(this.groupMap.size)
                    .setEnd())
                : t
                    .setCode(0)
                    .setNetworkType(this.getNetworkType())
                    .setText(0)
                    .setEnd(),
                this.triggerReady(),
                Gs.log(
                  'GroupController._initGroupList ok. initCost='.concat(
                    Gs.timeEnd(Bp.INIT_GROUP_LIST),
                    'ms'
                  )
                ),
                this.getGroupList()
            }
          },
          {
            key: '_initListeners',
            value: function() {
              var e = this.tim.innerEmitter
              e.once(Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED, this._initGroupList, this),
                e.on(Sp.CONVERSATION_LIST_UPDATED, this._handleUpdateGroupLastMessage, this),
                e.on(Sp.MESSAGE_GROUP_INSTANT_RECEIVED, this._handleReceivedGroupMessage, this),
                e.on(Sp.PROFILE_UPDATED, this._handleProfileUpdated, this)
            }
          },
          {
            key: 'emitGroupListUpdate',
            value: function() {
              var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0],
                t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
                n = this.getLocalGroups()
              t && this.tim.innerEmitter.emit(Sp.GROUP_LIST_UPDATED, n),
                e && this.tim.outerEmitter.emit(on.GROUP_LIST_UPDATED, n)
            }
          },
          {
            key: '_handleReceivedGroupMessage',
            value: function(e) {
              var t = this,
                n = e.data.eventDataList
              Array.isArray(n) &&
                n.forEach(function(e) {
                  var n = e.conversationID.replace(an.CONV_GROUP, '')
                  t.groupMap.has(n) &&
                    (t.groupMap.get(n).nextMessageSeq = e.lastMessage.sequence + 1)
                })
            }
          },
          {
            key: '_onReceivedGroupSystemNotice',
            value: function(e) {
              var t = e.data
              this.groupNoticeHandler._onReceivedGroupNotice(t)
            }
          },
          {
            key: '_handleUpdateGroupLastMessage',
            value: function(e) {
              if (0 !== this.groupMap.size) {
                for (var t = !1, n = 0; n < e.length; n++) {
                  var r = e[n],
                    o = r.type === an.CONV_GROUP
                  if (r.conversationID && o) {
                    var i = r.conversationID.split(/^GROUP/)[1],
                      a = this.getLocalGroupProfile(i)
                    a && ((a.lastMessage = r.lastMessage), (t = !0))
                  }
                }
                t &&
                  ((this.groupMap = this._sortLocalGroupList(this.groupMap)),
                  this.emitGroupListUpdate(!0, !1))
              } else this.tempConversationList = e
            }
          },
          {
            key: '_sortLocalGroupList',
            value: function(e) {
              var t = bn(e).filter(function(e) {
                var t = wn(e, 2)
                t[0]
                return !gu(t[1].lastMessage)
              })
              return (
                t.sort(function(e, t) {
                  return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime
                }),
                new Map([].concat(bn(t), bn(e)))
              )
            }
          },
          {
            key: '_getStorageGroupList',
            value: function() {
              return this.tim.storage.getItem('groupMap')
            }
          },
          {
            key: '_setStorageGroupList',
            value: function() {
              var e = this.getLocalGroups()
                .filter(function(e) {
                  var t = e.type
                  return !lu(t)
                })
                .slice(0, 20)
                .map(function(e) {
                  return { groupID: e.groupID, name: e.name, avatar: e.avatar, type: e.type }
                })
              this.tim.storage.setItem('groupMap', e)
            }
          },
          {
            key: 'updateGroupMap',
            value: function(e) {
              var t = this
              e.forEach(function(e) {
                t.groupMap.has(e.groupID)
                  ? t.groupMap.get(e.groupID).updateGroup(e)
                  : t.groupMap.set(e.groupID, new Tg(e))
              }),
                this._setStorageGroupList()
            }
          },
          {
            key: '_updateLocalGroupMemberMap',
            value: function(e, t) {
              var n = this
              return Ks(t) && 0 !== t.length
                ? t.map(function(t) {
                    return (
                      n.hasLocalGroupMember(e, t.userID)
                        ? n.getLocalGroupMemberInfo(e, t.userID).updateMember(t)
                        : n.setLocalGroupMember(e, new Kg(t)),
                      n.getLocalGroupMemberInfo(e, t.userID)
                    )
                  })
                : []
            }
          },
          {
            key: 'deleteLocalGroupMembers',
            value: function(e, t) {
              var n = this.groupMemberListMap.get(e)
              n &&
                t.forEach(function(e) {
                  n.delete(e)
                })
            }
          },
          {
            key: '_modifyGroupMemberInfo',
            value: function(e) {
              var t = this,
                n = e.groupID,
                r = e.userID,
                o = this.createPackage({ name: 'group', action: 'modifyGroupMemberInfo', param: e })
              return this.tim.connectionController.request(o).then(function() {
                if (t.hasLocalGroupMember(n, r)) {
                  var o = t.getLocalGroupMemberInfo(n, r)
                  return (
                    Bs(e.muteTime) || o.updateMuteUntil(e.muteTime),
                    Bs(e.role) || o.updateRole(e.role),
                    Bs(e.nameCard) || o.updateNameCard(e.nameCard),
                    Bs(e.memberCustomField) || o.updateMemberCustomField(e.memberCustomField),
                    o
                  )
                }
                return t.getGroupMemberProfile({ groupID: n, userIDList: [r] }).then(function(e) {
                  return wn(e.data.memberList, 1)[0]
                })
              })
            }
          },
          {
            key: '_groupListTreeShaking',
            value: function(e) {
              for (var t = new Map(bn(this.groupMap)), n = 0, r = e.length; n < r; n++)
                t.delete(e[n].groupID)
              this.AVChatRoomHandler.hasJoinedAVChatRoom() &&
                t.delete(this.AVChatRoomHandler.group.groupID)
              for (var o = bn(t.keys()), i = 0, a = o.length; i < a; i++) this.groupMap.delete(o[i])
            }
          },
          {
            key: '_handleProfileUpdated',
            value: function(e) {
              for (
                var t = this,
                  n = e.data,
                  r = function(e) {
                    var r = n[e]
                    t.groupMemberListMap.forEach(function(e) {
                      e.has(r.userID) &&
                        e.get(r.userID).updateMember({ nick: r.nick, avatar: r.avatar })
                    })
                  },
                  o = 0;
                o < n.length;
                o++
              )
                r(o)
            }
          },
          {
            key: 'getJoinedAVChatRoom',
            value: function() {
              return this.AVChatRoomHandler.getJoinedAVChatRoom()
            }
          },
          {
            key: 'deleteLocalGroupAndConversation',
            value: function(e) {
              this._deleteLocalGroup(e),
                this.tim.conversationController.deleteLocalConversation('GROUP'.concat(e)),
                this.emitGroupListUpdate(!0, !1)
            }
          },
          {
            key: 'checkJoinedAVChatRoomByID',
            value: function(e) {
              return this.AVChatRoomHandler.checkJoinedAVChatRoomByID(e)
            }
          },
          {
            key: 'reset',
            value: function() {
              this.groupMap.clear(),
                this.groupMemberListMap.clear(),
                this.resetReady(),
                this.groupNoticeHandler.reset(),
                this.AVChatRoomHandler.reset(),
                this.tim.innerEmitter.once(
                  Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED,
                  this._initGroupList,
                  this
                )
            }
          }
        ]),
        t
      )
    })(wp),
    Wg = Math.floor
  Ne(
    { target: 'Number', stat: !0 },
    {
      isInteger: function(e) {
        return !m(e) && isFinite(e) && Wg(e) === e
      }
    }
  )
  var zg = function() {
      for (var e = [], t = Xg(arguments), n = 0; n < arguments.length; n++)
        Number.isInteger(arguments[n])
          ? e.push(arguments[n])
          : e.push(!0 == !!arguments[n] ? '1' : '0')
      return e.join(t)
    },
    Xg = function(e) {
      var t = e.length,
        n = e[t - 1]
      if ('string' != typeof n) return ''
      if (n.length > 1) return ''
      var r = e[t - 1]
      return delete e[t - 1], (e.length -= t === e.length ? 1 : 0), r
    },
    Jg = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          (n = Gn(this, Nn(t).call(this, e)))._initializeMembers(),
          n.tim.innerEmitter.on(Sp.SIGN_LOGIN_SUCCESS, function() {
            n._initializeStatus(), n._bindListener()
          }),
          n.tim.innerEmitter.on(Sp.SIGN_LOGOUT_EXECUTING, function() {
            n._initializeStatus(), n._unbindListener()
          }),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initializeMembers',
            value: function() {
              ;(this.normalTimeout = 300),
                (this.realtimeNoticeTimeout = 11e4),
                (this.channelMaxTimeout = 3e5)
            }
          },
          {
            key: '_initializeStatus',
            value: function() {
              this._initializeAccountStatus(), this._initializeChannelStatus()
            }
          },
          {
            key: '_initializeAccountStatus',
            value: function() {
              this.accountStatus = { lastSignInTime: 0, status: yu.ACCOUNT_STATUS.SIGN_OUT }
            }
          },
          {
            key: '_initializeChannelStatus',
            value: function() {
              this.channelStatus = {
                startTime: 0,
                offlineTime: 0,
                failCount: 0,
                lastRequestTime: 0,
                lastJitterTime: 0,
                jitterCount: 0,
                jitters: [],
                status: yu.CHANNEL_STATUS.OFFLINE
              }
            }
          },
          {
            key: 'getChannelStatus',
            value: function() {
              return this.channelStatus.status
            }
          },
          {
            key: '_channelStatusJittersUpdate',
            value: function(e) {
              this.channelStatus.jitterCount++,
                (this.channelStatus.lastJitterTime = e),
                this.channelStatus.jitters.push(e),
                this.channelStatus.jitters.length > 5 && this.channelStatus.jitters.pop()
            }
          },
          {
            key: '_bindListener',
            value: function() {
              var e = this.tim.innerEmitter
              e.on(Sp.NOTICE_LONGPOLL_START, this._onChannelStart, this),
                e.on(Sp.NOTICE_LONGPOLL_REQUEST_ARRIVED, this._onChannelRequestSuccess, this),
                e.on(Sp.NOTICE_LONGPOLL_REQUEST_NOT_ARRIVED, this._onChannelFail, this),
                e.on(Sp.NOTICE_LONGPOLL_REQUEST_ERROR, this._onChannelResponseError, this)
            }
          },
          {
            key: '_unbindListener',
            value: function() {
              var e = this.tim.innerEmitter
              e.off(Sp.NOTICE_LONGPOLL_START, this._onChannelStart, this),
                e.off(Sp.NOTICE_LONGPOLL_REQUEST_ARRIVED, this._onChannelRequestSuccess, this),
                e.off(Sp.NOTICE_LONGPOLL_REQUEST_NOT_ARRIVED, this._onChannelFail, this),
                e.off(Sp.NOTICE_LONGPOLL_REQUEST_ERROR, this._onChannelResponseError, this)
            }
          },
          {
            key: '_onChannelStart',
            value: function() {
              ;(this.channelStatus.startTime = +new Date()),
                (this.channelStatus.status = yu.CHANNEL_STATUS.ONLINE)
            }
          },
          {
            key: '_onChannelRequestSuccess',
            value: function() {
              var e = this.tim.innerEmitter,
                t = Date.now(),
                n =
                  t -
                  (this.channelStatus.lastRequestTime > 0
                    ? this.channelStatus.lastRequestTime
                    : Date.now() + 100),
                r = zg(n < this.realtimeNoticeTimeout, n < this.channelMaxTimeout)
              switch (
                ((this.channelStatus.status = yu.CHANNEL_STATUS.ONLINE),
                (this.channelStatus.failCount = 0),
                r)
              ) {
                case '11':
                  break
                case '01':
                  e.emit(Sp.NOTICE_LONGPOLL_SOON_RECONNECT)
                  break
                case '00':
                  e.emit(Sp.NOTICE_LONGPOLL_LONG_RECONNECT)
              }
              this.channelStatus.lastRequestTime = t
            }
          },
          {
            key: '_onChannelFail',
            value: function(e) {
              var t = this.tim.innerEmitter,
                n = Date.now()
              this.channelStatus.status = yu.CHANNEL_STATUS.OFFLINE
              var r =
                n -
                (0 === this.channelStatus.offlineTime
                  ? this.channelStatus.lastRequestTime
                  : this.channelStatus.offlineTime)
              ;(this.channelStatus.offlineTime = n),
                this.channelStatus.failCount++,
                Gs.log(
                  '_onChannelFail count : '
                    .concat(this.channelStatus.failCount, '  time diff: ')
                    .concat(r, ';')
                ),
                this.channelStatus.failCount > 5 &&
                  r < 5e3 &&
                  (t.emit(Sp.NOTICE_LONGPOLL_DISCONNECT),
                  Gs.error('Detected notice channel offline, please check your network!'))
            }
          },
          {
            key: '_onChannelResponseError',
            value: function(e) {
              if (e instanceof np) {
                var t = this.tim.innerEmitter
                switch (((this.channelStatus.status = yu.CHANNEL_STATUS.OFFLINE), e.code)) {
                  case rp.MESSAGE_A2KEY_EXPIRED:
                  case rp.ACCOUNT_A2KEY_EXPIRED:
                    t.emit(Sp.SIGN_A2KEY_EXPIRED), t.emit(Sp.NOTICE_LONGPOLL_DISCONNECT)
                    break
                  case rp.LONG_POLL_API_PARAM_ERROR:
                    Gs.error(e.code, e.message)
                    break
                  default:
                    t.emit(Sp.ERROR_DETECTED, e)
                }
              } else
                Gs.warn(
                  'StatusController._onChannelResponseError: Unhandled error '.concat(
                    e.message,
                    ':'
                  )
                )
            }
          }
        ]),
        t
      )
    })(wp)
  function Qg() {
    return null
  }
  var Zg = (function() {
      function e(t) {
        In(this, e),
          (this.tim = t),
          (this.isWX = es),
          (this.storageQueue = new Map()),
          (this.checkTimes = 0),
          (this.checkTimer = setInterval(this._onCheckTimer.bind(this), 1e3)),
          this._errorTolerantHandle()
      }
      return (
        Tn(e, [
          {
            key: '_errorTolerantHandle',
            value: function() {
              !this.isWX &&
                Bs(window.localStorage) &&
                ((this.getItem = Qg),
                (this.setItem = Qg),
                (this.removeItem = Qg),
                (this.clear = Qg))
            }
          },
          {
            key: '_onCheckTimer',
            value: function() {
              if ((this.checkTimes++, this.checkTimes % 20 == 0)) {
                if (0 === this.storageQueue.size) return
                this._doFlush()
              }
            }
          },
          {
            key: '_doFlush',
            value: function() {
              try {
                var e = !0,
                  t = !1,
                  n = void 0
                try {
                  for (
                    var r, o = this.storageQueue[Symbol.iterator]();
                    !(e = (r = o.next()).done);
                    e = !0
                  ) {
                    var i = wn(r.value, 2),
                      a = i[0],
                      s = i[1]
                    this.isWX
                      ? wx.setStorageSync(this._getKey(a), s)
                      : localStorage.setItem(this._getKey(a), JSON.stringify(s))
                  }
                } catch (u) {
                  ;(t = !0), (n = u)
                } finally {
                  try {
                    e || null == o.return || o.return()
                  } finally {
                    if (t) throw n
                  }
                }
                this.storageQueue.clear()
              } catch (kd) {
                Gs.warn('Storage._doFlush error', kd)
              }
            }
          },
          {
            key: '_getPrefix',
            value: function() {
              var e = this.tim.loginInfo,
                t = e.SDKAppID,
                n = e.identifier
              return 'TIM_'.concat(t, '_').concat(n, '_')
            }
          },
          {
            key: 'getItem',
            value: function(e) {
              var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
              try {
                var n = t ? this._getKey(e) : e
                return this.isWX ? wx.getStorageSync(n) : JSON.parse(localStorage.getItem(n))
              } catch (kd) {
                Gs.warn('Storage.getItem error:', kd)
              }
            }
          },
          {
            key: 'setItem',
            value: function(e, t) {
              var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2],
                r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3]
              if (n) {
                var o = r ? this._getKey(e) : e
                this.isWX ? wx.setStorageSync(o, t) : localStorage.setItem(o, JSON.stringify(t))
              } else this.storageQueue.set(e, t)
            }
          },
          {
            key: 'clear',
            value: function() {
              try {
                this.isWX ? wx.clearStorageSync() : localStorage.clear()
              } catch (kd) {
                Gs.warn('Storage.clear error:', kd)
              }
            }
          },
          {
            key: 'removeItem',
            value: function(e) {
              var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
              try {
                var n = t ? this._getKey(e) : e
                this.isWX ? wx.removeStorageSync(n) : localStorage.removeItem(n)
              } catch (kd) {
                Gs.warn('Storage.removeItem error:', kd)
              }
            }
          },
          {
            key: 'getSize',
            value: function(e) {
              var t = this,
                n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'b'
              try {
                var r = { size: 0, limitSize: 5242880, unit: n }
                if (
                  (Object.defineProperty(r, 'leftSize', {
                    enumerable: !0,
                    get: function() {
                      return r.limitSize - r.size
                    }
                  }),
                  this.isWX && (r.limitSize = 1024 * wx.getStorageInfoSync().limitSize),
                  e)
                )
                  r.size = JSON.stringify(this.getItem(e)).length + this._getKey(e).length
                else if (this.isWX) {
                  var o = wx.getStorageInfoSync(),
                    i = o.keys
                  i.forEach(function(e) {
                    r.size += JSON.stringify(wx.getStorageSync(e)).length + t._getKey(e).length
                  })
                } else
                  for (var a in localStorage)
                    localStorage.hasOwnProperty(a) &&
                      (r.size += localStorage.getItem(a).length + a.length)
                return this._convertUnit(r)
              } catch (kd) {
                Gs.warn('Storage.getSize error:', kd)
              }
            }
          },
          {
            key: '_convertUnit',
            value: function(e) {
              var t = {},
                n = e.unit
              for (var r in ((t.unit = n), e))
                'number' == typeof e[r] &&
                  ('kb' === n.toLowerCase()
                    ? (t[r] = Math.round(e[r] / 1024))
                    : 'mb' === n.toLowerCase()
                    ? (t[r] = Math.round(e[r] / 1024 / 1024))
                    : (t[r] = e[r]))
              return t
            }
          },
          {
            key: '_getKey',
            value: function(e) {
              return ''.concat(this._getPrefix()).concat(e)
            }
          },
          {
            key: 'reset',
            value: function() {
              this._doFlush(), (this.checkTimes = 0)
            }
          }
        ]),
        e
      )
    })(),
    ed = t(function(e) {
      var t = Object.prototype.hasOwnProperty,
        n = '~'
      function r() {}
      function o(e, t, n) {
        ;(this.fn = e), (this.context = t), (this.once = n || !1)
      }
      function i(e, t, r, i, a) {
        if ('function' != typeof r) throw new TypeError('The listener must be a function')
        var s = new o(r, i || e, a),
          u = n ? n + t : t
        return (
          e._events[u]
            ? e._events[u].fn
              ? (e._events[u] = [e._events[u], s])
              : e._events[u].push(s)
            : ((e._events[u] = s), e._eventsCount++),
          e
        )
      }
      function a(e, t) {
        0 == --e._eventsCount ? (e._events = new r()) : delete e._events[t]
      }
      function s() {
        ;(this._events = new r()), (this._eventsCount = 0)
      }
      Object.create && ((r.prototype = Object.create(null)), new r().__proto__ || (n = !1)),
        (s.prototype.eventNames = function() {
          var e,
            r,
            o = []
          if (0 === this._eventsCount) return o
          for (r in (e = this._events)) t.call(e, r) && o.push(n ? r.slice(1) : r)
          return Object.getOwnPropertySymbols ? o.concat(Object.getOwnPropertySymbols(e)) : o
        }),
        (s.prototype.listeners = function(e) {
          var t = n ? n + e : e,
            r = this._events[t]
          if (!r) return []
          if (r.fn) return [r.fn]
          for (var o = 0, i = r.length, a = new Array(i); o < i; o++) a[o] = r[o].fn
          return a
        }),
        (s.prototype.listenerCount = function(e) {
          var t = n ? n + e : e,
            r = this._events[t]
          return r ? (r.fn ? 1 : r.length) : 0
        }),
        (s.prototype.emit = function(e, t, r, o, i, a) {
          var s = n ? n + e : e
          if (!this._events[s]) return !1
          var u,
            c,
            l = this._events[s],
            p = arguments.length
          if (l.fn) {
            switch ((l.once && this.removeListener(e, l.fn, void 0, !0), p)) {
              case 1:
                return l.fn.call(l.context), !0
              case 2:
                return l.fn.call(l.context, t), !0
              case 3:
                return l.fn.call(l.context, t, r), !0
              case 4:
                return l.fn.call(l.context, t, r, o), !0
              case 5:
                return l.fn.call(l.context, t, r, o, i), !0
              case 6:
                return l.fn.call(l.context, t, r, o, i, a), !0
            }
            for (c = 1, u = new Array(p - 1); c < p; c++) u[c - 1] = arguments[c]
            l.fn.apply(l.context, u)
          } else {
            var h,
              f = l.length
            for (c = 0; c < f; c++)
              switch ((l[c].once && this.removeListener(e, l[c].fn, void 0, !0), p)) {
                case 1:
                  l[c].fn.call(l[c].context)
                  break
                case 2:
                  l[c].fn.call(l[c].context, t)
                  break
                case 3:
                  l[c].fn.call(l[c].context, t, r)
                  break
                case 4:
                  l[c].fn.call(l[c].context, t, r, o)
                  break
                default:
                  if (!u) for (h = 1, u = new Array(p - 1); h < p; h++) u[h - 1] = arguments[h]
                  l[c].fn.apply(l[c].context, u)
              }
          }
          return !0
        }),
        (s.prototype.on = function(e, t, n) {
          return i(this, e, t, n, !1)
        }),
        (s.prototype.once = function(e, t, n) {
          return i(this, e, t, n, !0)
        }),
        (s.prototype.removeListener = function(e, t, r, o) {
          var i = n ? n + e : e
          if (!this._events[i]) return this
          if (!t) return a(this, i), this
          var s = this._events[i]
          if (s.fn) s.fn !== t || (o && !s.once) || (r && s.context !== r) || a(this, i)
          else {
            for (var u = 0, c = [], l = s.length; u < l; u++)
              (s[u].fn !== t || (o && !s[u].once) || (r && s[u].context !== r)) && c.push(s[u])
            c.length ? (this._events[i] = 1 === c.length ? c[0] : c) : a(this, i)
          }
          return this
        }),
        (s.prototype.removeAllListeners = function(e) {
          var t
          return (
            e
              ? ((t = n ? n + e : e), this._events[t] && a(this, t))
              : ((this._events = new r()), (this._eventsCount = 0)),
            this
          )
        }),
        (s.prototype.off = s.prototype.removeListener),
        (s.prototype.addListener = s.prototype.on),
        (s.prefixed = n),
        (s.EventEmitter = s),
        (e.exports = s)
    }),
    td = function(e) {
      var t, n, r, o, i
      return (
        gu(e.context)
          ? ((t = ''), (n = 0), (r = 0), (o = 0), (i = 1))
          : ((t = e.context.a2Key),
            (n = e.context.tinyID),
            (r = e.context.SDKAppID),
            (o = e.context.contentType),
            (i = e.context.apn)),
        {
          platform: mp,
          websdkappid: dp,
          v: gp,
          a2: t,
          tinyid: n,
          sdkappid: r,
          contentType: o,
          apn: i,
          reqtime: function() {
            return +new Date()
          }
        }
      )
    },
    nd = (function() {
      function e(t) {
        In(this, e),
          (this.isReady = !1),
          (this.tim = t),
          (this.context = t.context),
          this._initList(),
          this._updateWhenCTXIsReady()
      }
      return (
        Tn(e, [
          {
            key: '_updateWhenCTXIsReady',
            value: function() {
              this.tim.innerEmitter.on(Sp.CONTEXT_UPDATED, this.update, this),
                this.tim.innerEmitter.on(Sp.CONTEXT_RESET, this.reset, this)
            }
          },
          {
            key: 'update',
            value: function(e) {
              var t = e.context
              ;(this.context = t), this._initList()
            }
          },
          {
            key: 'reset',
            value: function(e) {
              ;(this.context = e.data), this._initList()
            }
          },
          {
            key: 'get',
            value: function(e) {
              var t = e.name,
                n = e.action,
                r = e.param,
                o = e.tjgID
              if (void 0 === this.config[t])
                throw new np({
                  code: rp.NETWORK_PACKAGE_UNDEFINED,
                  message: ''.concat(op.NETWORK_PACKAGE_UNDEFINED, ': PackageConfig.').concat(t)
                })
              if (void 0 === this.config[t][n])
                throw new np({
                  code: rp.NETWORK_PACKAGE_UNDEFINED,
                  message: ''
                    .concat(op.NETWORK_PACKAGE_UNDEFINED, ': PackageConfig.')
                    .concat(t, '.')
                    .concat(n)
                })
              var i = (function e(t) {
                if (0 === Object.getOwnPropertyNames(t).length) return Object.create(null)
                var n = Array.isArray(t) ? [] : Object.create(null),
                  r = ''
                for (var o in t)
                  null !== t[o]
                    ? void 0 !== t[o]
                      ? ((r = Sn(t[o])),
                        ['string', 'number', 'function', 'boolean'].indexOf(r) >= 0
                          ? (n[o] = t[o])
                          : (n[o] = e(t[o])))
                      : (n[o] = void 0)
                    : (n[o] = null)
                return n
              })(this.config[t][n])
              return (
                (i.requestData = this._initRequestData(r, i)),
                (i.encode = this._initEncoder(i)),
                (i.decode = this._initDecoder(i)),
                o && (i.queryString.tjg_id = o),
                i
              )
            }
          },
          {
            key: 'set',
            value: function(e) {
              var t = e.key,
                n = e.value
              if (!1 != !!t) {
                var r = t.split('.')
                if (!(r.length <= 0)) {
                  !(function e(t, n, r, o) {
                    var i = n[r]
                    'object' === Sn(t[i]) ? e(t[i], n, r + 1, o) : (t[i] = o)
                  })(this.config, r, 0, n)
                }
              }
            }
          },
          {
            key: '_initList',
            value: function() {
              var e
              ;(this.config = {}),
                (this.config.accessLayer =
                  ((e = this.tim),
                  {
                    create: null,
                    query: {
                      serverName: vp.NAME.WEB_IM,
                      cmd: vp.CMD.ACCESS_LAYER,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        platform: mp,
                        identifier: e.loginInfo.identifier,
                        usersig: e.loginInfo.userSig,
                        contentType: e.loginInfo.contentType,
                        apn: null !== e.context ? e.context.apn : 1,
                        websdkappid: dp,
                        v: gp
                      },
                      requestData: {}
                    },
                    update: null,
                    delete: null
                  })),
                (this.config.login = (function(e) {
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.LOGIN,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        identifier: e.loginInfo.identifier,
                        usersig: e.loginInfo.userSig,
                        sdkappid: e.loginInfo.SDKAppID,
                        accounttype: e.loginInfo.accountType,
                        contentType: null !== e.context ? e.context.contentType : 0,
                        apn: null !== e.context ? e.context.apn : 1,
                        reqtime: +new Date() / 1e3
                      },
                      requestData: { state: 'Online' },
                      keyMaps: { request: { tinyID: 'tinyId' }, response: { TinyId: 'tinyID' } }
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.logout = (function(e) {
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.LOGOUT_ALL,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        a2: null !== e.context ? e.context.a2Key : '',
                        tinyid: null !== e.context ? e.context.tinyID : '',
                        sdkappid: null !== e.loginInfo ? e.loginInfo.SDKAppID : 0,
                        contentType: null !== e.context ? e.context.contentType : 0,
                        apn: null !== e.context ? e.context.apn : '',
                        reqtime: +new Date() / 1e3
                      },
                      requestData: {}
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.longPollLogout = (function(e) {
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.LOGOUT_LONG_POLL,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        a2: null !== e.context ? e.context.a2Key : '',
                        tinyid: null !== e.context ? e.context.tinyID : 0,
                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                        contentType: null !== e.context ? e.context.contentType : 0,
                        apn: null !== e.context ? e.context.apn : 1,
                        reqtime: function() {
                          return Date.now()
                        }
                      },
                      requestData: { longPollID: '' },
                      keyMaps: { request: { longPollID: 'LongPollingId' } }
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.profile = (function(e) {
                  var t = td(e),
                    n = vp.NAME.PROFILE,
                    r = vp.CHANNEL.XHR,
                    o = yp
                  return {
                    query: {
                      serverName: n,
                      cmd: vp.CMD.PORTRAIT_GET,
                      channel: r,
                      protocol: o,
                      method: 'POST',
                      queryString: t,
                      requestData: { fromAccount: '', userItem: [] },
                      keyMaps: {
                        request: {
                          toAccount: 'To_Account',
                          standardSequence: 'StandardSequence',
                          customSequence: 'CustomSequence'
                        }
                      }
                    },
                    update: {
                      serverName: n,
                      cmd: vp.CMD.PORTRAIT_SET,
                      channel: r,
                      protocol: o,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: '',
                        profileItem: [
                          { tag: Fl.NICK, value: '' },
                          { tag: Fl.GENDER, value: '' },
                          { tag: Fl.ALLOWTYPE, value: '' },
                          { tag: Fl.AVATAR, value: '' }
                        ]
                      }
                    }
                  }
                })(this.tim)),
                (this.config.group = (function(e) {
                  var t = {
                      websdkappid: dp,
                      v: gp,
                      platform: mp,
                      a2: null !== e.context && e.context.a2Key ? e.context.a2Key : void 0,
                      tinyid: null !== e.context && e.context.tinyID ? e.context.tinyID : void 0,
                      sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                      contentType: null !== e.context ? e.context.contentType : 0,
                      accounttype: null !== e.context ? e.context.accountType : 0
                    },
                    n = {
                      request: {
                        ownerID: 'Owner_Account',
                        userID: 'Member_Account',
                        newOwnerID: 'NewOwner_Account',
                        maxMemberNum: 'MaxMemberCount',
                        groupCustomField: 'AppDefinedData',
                        memberCustomField: 'AppMemberDefinedData',
                        groupCustomFieldFilter: 'AppDefinedDataFilter_Group',
                        memberCustomFieldFilter: 'AppDefinedDataFilter_GroupMember',
                        messageRemindType: 'MsgFlag',
                        userIDList: 'MemberList',
                        groupIDList: 'GroupIdList',
                        applyMessage: 'ApplyMsg',
                        muteTime: 'ShutUpTime',
                        joinOption: 'ApplyJoinOption'
                      },
                      response: {
                        GroupIdList: 'groups',
                        MsgFlag: 'messageRemindType',
                        AppDefinedData: 'groupCustomField',
                        AppMemberDefinedData: 'memberCustomField',
                        AppDefinedDataFilter_Group: 'groupCustomFieldFilter',
                        AppDefinedDataFilter_GroupMember: 'memberCustomFieldFilter',
                        InfoSeq: 'infoSequence',
                        MemberList: 'members',
                        GroupInfo: 'groups',
                        ShutUpUntil: 'muteUntil',
                        ApplyJoinOption: 'joinOption'
                      }
                    }
                  return {
                    create: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.CREATE_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        type: an.GRP_PRIVATE,
                        name: void 0,
                        groupID: void 0,
                        ownerID: e.loginInfo.identifier,
                        introduction: void 0,
                        notification: void 0,
                        avatar: void 0,
                        maxMemberNum: void 0,
                        joinOption: void 0,
                        memberList: void 0,
                        groupCustomField: void 0
                      },
                      keyMaps: n
                    },
                    list: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_JOINED_GROUPS,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        userID: e.loginInfo.identifier,
                        limit: void 0,
                        offset: void 0,
                        groupType: void 0,
                        responseFilter: void 0
                      },
                      keyMaps: n
                    },
                    query: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_GROUP_INFO,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupIDList: void 0, responseFilter: void 0 },
                      keyMaps: n
                    },
                    getGroupMemberProfile: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_GROUP_MEMBER_INFO,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        userIDList: void 0,
                        memberInfoFilter: void 0,
                        memberCustomFieldFilter: void 0
                      },
                      keyMaps: {
                        request: An({}, n.request, { userIDList: 'Member_List_Account' }),
                        response: n.response
                      }
                    },
                    getGroupMemberList: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_GROUP_MEMBER_LIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        limit: 0,
                        offset: 0,
                        memberRoleFilter: void 0,
                        memberInfoFilter: void 0
                      },
                      keyMaps: n
                    },
                    quitGroup: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.QUIT_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupID: void 0 }
                    },
                    changeGroupOwner: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.CHANGE_GROUP_OWNER,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupID: void 0, newOwnerID: void 0 },
                      keyMaps: n
                    },
                    destroyGroup: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.DESTROY_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupID: void 0 }
                    },
                    updateGroupProfile: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.MODIFY_GROUP_INFO,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        name: void 0,
                        introduction: void 0,
                        notification: void 0,
                        avatar: void 0,
                        maxMemberNum: void 0,
                        joinOption: void 0,
                        groupCustomField: void 0
                      },
                      keyMaps: {
                        request: An({}, n.request, { groupCustomField: 'AppDefinedData' }),
                        response: n.response
                      }
                    },
                    modifyGroupMemberInfo: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.MODIFY_GROUP_MEMBER_INFO,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        userID: void 0,
                        messageRemindType: void 0,
                        nameCard: void 0,
                        role: void 0,
                        memberCustomField: void 0,
                        muteTime: void 0
                      },
                      keyMaps: n
                    },
                    addGroupMember: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.ADD_GROUP_MEMBER,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupID: void 0, silence: void 0, userIDList: void 0 },
                      keyMaps: n
                    },
                    deleteGroupMember: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.DELETE_GROUP_MEMBER,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { groupID: void 0, userIDList: void 0, reason: void 0 },
                      keyMaps: { request: { userIDList: 'MemberToDel_Account' } }
                    },
                    searchGroupByID: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.SEARCH_GROUP_BY_ID,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupIDList: void 0,
                        responseFilter: {
                          groupBasePublicInfoFilter: [
                            'Type',
                            'Name',
                            'Introduction',
                            'Notification',
                            'FaceUrl',
                            'CreateTime',
                            'Owner_Account',
                            'LastInfoTime',
                            'LastMsgTime',
                            'NextMsgSeq',
                            'MemberNum',
                            'MaxMemberNum',
                            'ApplyJoinOption'
                          ]
                        }
                      },
                      keyMaps: { request: { groupIDList: 'GroupIdList' } }
                    },
                    applyJoinGroup: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.APPLY_JOIN_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        applyMessage: void 0,
                        userDefinedField: void 0
                      },
                      keyMaps: n
                    },
                    applyJoinAVChatRoom: {
                      serverName: vp.NAME.BIG_GROUP_NO_AUTH,
                      cmd: vp.CMD.APPLY_JOIN_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                        contentType: null !== e.context ? e.context.contentType : 0,
                        accounttype: null !== e.context ? e.context.accountType : 0
                      },
                      requestData: {
                        groupID: void 0,
                        applyMessage: void 0,
                        userDefinedField: void 0
                      },
                      keyMaps: n
                    },
                    handleApplyJoinGroup: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.HANDLE_APPLY_JOIN_GROUP,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        groupID: void 0,
                        applicant: void 0,
                        handleAction: void 0,
                        handleMessage: void 0,
                        authentication: void 0,
                        messageKey: void 0,
                        userDefinedField: void 0
                      },
                      keyMaps: {
                        request: {
                          applicant: 'Applicant_Account',
                          handleAction: 'HandleMsg',
                          handleMessage: 'ApprovalMsg',
                          messageKey: 'MsgKey'
                        },
                        response: { MsgKey: 'messageKey' }
                      }
                    },
                    deleteGroupSystemNotice: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.DELETE_GROUP_SYSTEM_MESSAGE,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { messageListToDelete: void 0 },
                      keyMaps: {
                        request: {
                          messageListToDelete: 'DelMsgList',
                          messageSeq: 'MsgSeq',
                          messageRandom: 'MsgRandom'
                        }
                      }
                    },
                    getGroupPendency: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_GROUP_PENDENCY,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: t,
                      requestData: { startTime: void 0, limit: void 0, handleAccount: void 0 },
                      keyMaps: { request: { handleAccount: 'Handle_Account' } }
                    }
                  }
                })(this.tim)),
                (this.config.longPollID = (function(e) {
                  return {
                    create: {},
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.GET_LONG_POLL_ID,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        a2: null !== e.context ? e.context.a2Key : '',
                        tinyid: null !== e.context ? e.context.tinyID : 0,
                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                        contentType: null !== e.context ? e.context.contentType : 0,
                        apn: null !== e.context ? e.context.apn : 1,
                        reqtime: +new Date() / 1e3
                      },
                      requestData: {},
                      keyMaps: { response: { LongPollingId: 'longPollingID' } }
                    },
                    update: {},
                    delete: {}
                  }
                })(this.tim)),
                (this.config.longPoll = (function(e) {
                  var t = {
                    websdkappid: dp,
                    v: gp,
                    platform: mp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    accounttype: null !== e.context ? e.loginInfo.accountType : 0,
                    apn: null !== e.context ? e.context.apn : 1,
                    reqtime: Math.ceil(+new Date() / 1e3)
                  }
                  return {
                    create: {},
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.LONG_POLL,
                      channel: vp.CHANNEL.AUTO,
                      protocol: yp,
                      queryString: t,
                      requestData: {
                        timeout: null,
                        cookie: { notifySeq: 0, noticeSeq: 0, longPollingID: 0 }
                      },
                      keyMaps: {
                        response: {
                          C2cMsgArray: 'C2CMessageArray',
                          GroupMsgArray: 'groupMessageArray',
                          GroupTips: 'groupTips',
                          C2cNotifyMsgArray: 'C2CNotifyMessageArray',
                          ClientSeq: 'clientSequence',
                          MsgPriority: 'messagePriority',
                          NoticeSeq: 'noticeSequence',
                          MsgContent: 'content',
                          MsgType: 'type',
                          MsgBody: 'elements',
                          ToGroupId: 'to',
                          Desc: 'description',
                          Ext: 'extension'
                        }
                      }
                    },
                    update: {},
                    delete: {}
                  }
                })(this.tim)),
                (this.config.applyC2C = (function(e) {
                  var t = td(e),
                    n = vp.NAME.FRIEND,
                    r = vp.CHANNEL.XHR,
                    o = yp
                  return {
                    create: {
                      serverName: n,
                      cmd: vp.CMD.FRIEND_ADD,
                      channel: r,
                      protocol: o,
                      queryString: t,
                      requestData: { fromAccount: '', addFriendItem: [] }
                    },
                    get: {
                      serverName: n,
                      cmd: vp.CMD.GET_PENDENCY,
                      channel: r,
                      protocol: o,
                      queryString: t,
                      requestData: { fromAccount: '', pendencyType: 'Pendency_Type_ComeIn' }
                    },
                    update: {
                      serverName: n,
                      cmd: vp.CMD.RESPONSE_PENDENCY,
                      channel: r,
                      protocol: o,
                      queryString: t,
                      requestData: { fromAccount: '', responseFriendItem: [] }
                    },
                    delete: {
                      serverName: n,
                      cmd: vp.CMD.DELETE_PENDENCY,
                      channel: r,
                      protocol: o,
                      queryString: t,
                      requestData: {
                        fromAccount: '',
                        toAccount: [],
                        pendencyType: 'Pendency_Type_ComeIn'
                      }
                    }
                  }
                })(this.tim)),
                (this.config.friend = (function(e) {
                  var t = td(e),
                    n = vp.NAME.FRIEND,
                    r = vp.CHANNEL.XHR,
                    o = yp
                  return {
                    get: {
                      serverName: n,
                      cmd: vp.CMD.FRIEND_GET_ALL,
                      channel: r,
                      protocol: o,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: '',
                        timeStamp: 0,
                        startIndex: 0,
                        getCount: 100,
                        lastStandardSequence: 0,
                        tagList: ['Tag_Profile_IM_Nick', 'Tag_SNS_IM_Remark']
                      },
                      keyMaps: { request: {}, response: {} }
                    },
                    delete: {
                      serverName: n,
                      cmd: vp.CMD.FRIEND_DELETE,
                      channel: r,
                      protocol: o,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: '',
                        toAccount: [],
                        deleteType: 'Delete_Type_Single'
                      }
                    }
                  }
                })(this.tim)),
                (this.config.blacklist = (function(e) {
                  var t = td(e)
                  return {
                    create: {
                      serverName: vp.NAME.FRIEND,
                      cmd: vp.CMD.ADD_BLACKLIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { fromAccount: '', toAccount: [] }
                    },
                    get: {
                      serverName: vp.NAME.FRIEND,
                      cmd: vp.CMD.GET_BLACKLIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: '',
                        startIndex: 0,
                        maxLimited: 30,
                        lastSequence: 0
                      }
                    },
                    delete: {
                      serverName: vp.NAME.FRIEND,
                      cmd: vp.CMD.DELETE_BLACKLIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { fromAccount: '', toAccount: [] }
                    },
                    update: {}
                  }
                })(this.tim)),
                (this.config.c2cMessage = (function(e) {
                  var t = {
                      platform: mp,
                      websdkappid: dp,
                      v: gp,
                      a2: null !== e.context ? e.context.a2Key : '',
                      tinyid: null !== e.context ? e.context.tinyID : 0,
                      sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                      contentType: null !== e.context ? e.context.contentType : 0,
                      apn: null !== e.context ? e.context.apn : 1,
                      reqtime: function() {
                        return +new Date()
                      }
                    },
                    n = {
                      request: {
                        fromAccount: 'From_Account',
                        toAccount: 'To_Account',
                        msgTimeStamp: 'MsgTimeStamp',
                        msgSeq: 'MsgSeq',
                        msgRandom: 'MsgRandom',
                        msgBody: 'MsgBody',
                        count: 'MaxCnt',
                        lastMessageTime: 'LastMsgTime',
                        messageKey: 'MsgKey',
                        peerAccount: 'Peer_Account',
                        data: 'Data',
                        description: 'Desc',
                        extension: 'Ext',
                        type: 'MsgType',
                        content: 'MsgContent',
                        sizeType: 'Type',
                        uuid: 'UUID',
                        imageUrl: 'URL',
                        fileUrl: 'Url',
                        remoteAudioUrl: 'Url',
                        remoteVideoUrl: 'VideoUrl',
                        thumbUUID: 'ThumbUUID',
                        videoUUID: 'VideoUUID',
                        videoUrl: '',
                        downloadFlag: 'Download_Flag'
                      },
                      response: {
                        MsgContent: 'content',
                        MsgTime: 'time',
                        Data: 'data',
                        Desc: 'description',
                        Ext: 'extension',
                        MsgKey: 'messageKey',
                        MsgType: 'type',
                        MsgBody: 'elements',
                        Download_Flag: 'downloadFlag'
                      }
                    }
                  return {
                    create: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.SEND_MESSAGE,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: e.loginInfo.identifier,
                        toAccount: '',
                        msgTimeStamp: Math.ceil(+new Date() / 1e3),
                        msgSeq: 0,
                        msgRandom: 0,
                        msgBody: []
                      },
                      keyMaps: n
                    },
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.GET_C2C_ROAM_MESSAGES,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        peerAccount: '',
                        count: 15,
                        lastMessageTime: 0,
                        messageKey: '',
                        withRecalledMsg: 1
                      },
                      keyMaps: n
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.c2cMessageWillBeRevoked = (function(e) {
                  var t = {
                    platform: mp,
                    websdkappid: dp,
                    v: gp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    apn: null !== e.context ? e.context.apn : 1,
                    reqtime: function() {
                      return +new Date()
                    }
                  }
                  return {
                    create: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.REVOKE_C2C_MESSAGE,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        msgInfo: {
                          fromAccount: '',
                          toAccount: '',
                          msgTimeStamp: Math.ceil(+new Date() / 1e3),
                          msgSeq: 0,
                          msgRandom: 0
                        }
                      },
                      keyMaps: {
                        request: {
                          msgInfo: 'MsgInfo',
                          fromAccount: 'From_Account',
                          toAccount: 'To_Account',
                          msgTimeStamp: 'MsgTimeStamp',
                          msgSeq: 'MsgSeq',
                          msgRandom: 'MsgRandom',
                          msgBody: 'MsgBody'
                        }
                      }
                    }
                  }
                })(this.tim)),
                (this.config.groupMessage = (function(e) {
                  var t = {
                      platform: mp,
                      websdkappid: dp,
                      v: gp,
                      a2: null !== e.context ? e.context.a2Key : '',
                      tinyid: null !== e.context ? e.context.tinyID : 0,
                      sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                      contentType: null !== e.context ? e.context.contentType : 0,
                      apn: null !== e.context ? e.context.apn : 1,
                      reqtime: function() {
                        return +new Date()
                      }
                    },
                    n = {
                      request: {
                        to: 'GroupId',
                        extension: 'Ext',
                        data: 'Data',
                        description: 'Desc',
                        random: 'Random',
                        sequence: 'ReqMsgSeq',
                        count: 'ReqMsgNumber',
                        type: 'MsgType',
                        content: 'MsgContent',
                        elements: 'MsgBody',
                        sizeType: 'Type',
                        uuid: 'UUID',
                        imageUrl: 'URL',
                        fileUrl: 'Url',
                        remoteAudioUrl: 'Url',
                        remoteVideoUrl: 'VideoUrl',
                        thumbUUID: 'ThumbUUID',
                        videoUUID: 'VideoUUID',
                        videoUrl: '',
                        downloadFlag: 'Download_Flag',
                        clientSequence: 'ClientSeq'
                      },
                      response: {
                        Random: 'random',
                        MsgTime: 'time',
                        MsgSeq: 'sequence',
                        ReqMsgSeq: 'sequence',
                        RspMsgList: 'messageList',
                        IsPlaceMsg: 'isPlaceMessage',
                        IsSystemMsg: 'isSystemMessage',
                        ToGroupId: 'to',
                        EnumFrom_AccountType: 'fromAccountType',
                        EnumTo_AccountType: 'toAccountType',
                        GroupCode: 'groupCode',
                        MsgPriority: 'messagePriority',
                        MsgBody: 'elements',
                        MsgType: 'type',
                        MsgContent: 'content',
                        IsFinished: 'complete',
                        Download_Flag: 'downloadFlag',
                        ClientSeq: 'clientSequence'
                      }
                    }
                  return {
                    create: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.SEND_GROUP_MESSAGE,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        groupID: '',
                        fromAccount: e.loginInfo.identifier,
                        random: 0,
                        clientSequence: 0,
                        msgBody: []
                      },
                      keyMaps: n
                    },
                    query: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.GET_GROUP_ROAM_MESSAGES,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { withRecalledMsg: 1, groupID: '', count: 15, sequence: '' },
                      keyMaps: n
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.groupMessageWillBeRevoked = (function(e) {
                  var t = {
                    platform: mp,
                    websdkappid: dp,
                    v: gp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    apn: null !== e.context ? e.context.apn : 1,
                    reqtime: function() {
                      return +new Date()
                    }
                  }
                  return {
                    create: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.REVOKE_GROUP_MESSAGE,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { to: '', msgSeqList: [] },
                      keyMaps: {
                        request: { to: 'GroupId', msgSeqList: 'MsgSeqList', msgSeq: 'MsgSeq' }
                      }
                    }
                  }
                })(this.tim)),
                (this.config.conversation = (function(e) {
                  var t = {
                    platform: mp,
                    websdkappid: dp,
                    v: gp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    apn: null !== e.context ? e.context.apn : 1
                  }
                  return {
                    query: {
                      serverName: vp.NAME.RECENT_CONTACT,
                      cmd: vp.CMD.GET_CONVERSATION_LIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { fromAccount: e.loginInfo.identifier, count: 0 },
                      keyMaps: {
                        request: {},
                        response: {
                          SessionItem: 'conversations',
                          ToAccount: 'groupID',
                          To_Account: 'userID',
                          UnreadMsgCount: 'unreadCount',
                          MsgGroupReadedSeq: 'messageReadSeq'
                        }
                      }
                    },
                    pagingQuery: {
                      serverName: vp.NAME.RECENT_CONTACT,
                      cmd: vp.CMD.PAGING_GET_CONVERSATION_LIST,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { fromAccount: void 0, timeStamp: void 0, orderType: void 0 },
                      keyMaps: {
                        request: {},
                        response: {
                          SessionItem: 'conversations',
                          ToAccount: 'groupID',
                          To_Account: 'userID',
                          UnreadMsgCount: 'unreadCount',
                          MsgGroupReadedSeq: 'messageReadSeq'
                        }
                      }
                    },
                    delete: {
                      serverName: vp.NAME.RECENT_CONTACT,
                      cmd: vp.CMD.DELETE_CONVERSATION,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        fromAccount: e.loginInfo.identifier,
                        toAccount: void 0,
                        type: 1,
                        toGroupID: void 0
                      },
                      keyMaps: { request: { toGroupID: 'ToGroupid' } }
                    },
                    setC2CMessageRead: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.SET_C2C_MESSAGE_READ,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { C2CMsgReaded: void 0 },
                      keyMaps: { request: { lastMessageTime: 'LastedMsgTime' } }
                    },
                    setGroupMessageRead: {
                      serverName: vp.NAME.GROUP,
                      cmd: vp.CMD.SET_GROUP_MESSAGE_READ,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { groupID: void 0, messageReadSeq: void 0 },
                      keyMaps: { request: { messageReadSeq: 'MsgReadedSeq' } }
                    }
                  }
                })(this.tim)),
                (this.config.syncMessage = (function(e) {
                  var t = {
                    platform: mp,
                    websdkappid: dp,
                    v: gp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    apn: null !== e.context ? e.context.apn : 1,
                    reqtime: function() {
                      return [Math.ceil(+new Date()), Math.random()].join('')
                    }
                  }
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.GET_MESSAGES,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: { cookie: '', syncFlag: 0, needAbstract: 1 },
                      keyMaps: {
                        request: {
                          fromAccount: 'From_Account',
                          toAccount: 'To_Account',
                          from: 'From_Account',
                          to: 'To_Account',
                          time: 'MsgTimeStamp',
                          sequence: 'MsgSeq',
                          random: 'MsgRandom',
                          elements: 'MsgBody'
                        },
                        response: {
                          MsgList: 'messageList',
                          SyncFlag: 'syncFlag',
                          To_Account: 'to',
                          From_Account: 'from',
                          ClientSeq: 'clientSequence',
                          MsgSeq: 'sequence',
                          NoticeSeq: 'noticeSequence',
                          NotifySeq: 'notifySequence',
                          MsgRandom: 'random',
                          MsgTimeStamp: 'time',
                          MsgContent: 'content',
                          ToGroupId: 'groupID',
                          MsgKey: 'messageKey',
                          GroupTips: 'groupTips',
                          MsgBody: 'elements',
                          MsgType: 'type',
                          C2CRemainingUnreadCount: 'C2CRemainingUnreadList'
                        }
                      }
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.AVChatRoom = (function(e) {
                  return {
                    startLongPoll: {
                      serverName: vp.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,
                      cmd: vp.CMD.AVCHATROOM_LONG_POLL,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        sdkappid: e.loginInfo.SDKAppID,
                        accounttype: '792',
                        apn: null !== e.context ? e.context.apn : 1,
                        reqtime: function() {
                          return +new Date()
                        }
                      },
                      requestData: { USP: 1, startSeq: 1, holdTime: 90, key: void 0 },
                      keyMaps: { request: { USP: 'USP' }, response: { ToGroupId: 'groupID' } }
                    }
                  }
                })(this.tim)),
                (this.config.cosUpload = (function(e) {
                  var t = {
                    platform: mp,
                    websdkappid: dp,
                    v: gp,
                    a2: null !== e.context ? e.context.a2Key : '',
                    tinyid: null !== e.context ? e.context.tinyID : 0,
                    sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                    contentType: null !== e.context ? e.context.contentType : 0,
                    apn: null !== e.context ? e.context.apn : 1,
                    reqtime: function() {
                      return Date.now()
                    }
                  }
                  return {
                    create: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.FILE_UPLOAD,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        appVersion: '2.1',
                        fromAccount: '',
                        toAccount: '',
                        sequence: 0,
                        time: function() {
                          return Math.ceil(Date.now() / 1e3)
                        },
                        random: function() {
                          return tu()
                        },
                        fileStrMd5: '',
                        fileSize: '',
                        serverVer: 1,
                        authKey: '',
                        busiId: 1,
                        pkgFlag: 1,
                        sliceOffset: 0,
                        sliceSize: 0,
                        sliceData: '',
                        contentType: 'application/x-www-form-urlencoded'
                      },
                      keyMaps: { request: {}, response: {} }
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.cosSig = (function(e) {
                  var t = {
                    sdkappid: function() {
                      return e.loginInfo.SDKAppID
                    },
                    identifier: function() {
                      return e.loginInfo.identifier
                    },
                    userSig: function() {
                      return e.context.userSig
                    }
                  }
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.IM_COS_SIGN,
                      cmd: vp.CMD.COS_SIGN,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: t,
                      requestData: {
                        cmd: 'open_im_cos_svc',
                        subCmd: 'get_cos_token',
                        duration: 300,
                        version: 2
                      },
                      keyMaps: {
                        request: {
                          userSig: 'usersig',
                          subCmd: 'sub_cmd',
                          cmd: 'cmd',
                          duration: 'duration',
                          version: 'version'
                        },
                        response: {
                          expired_time: 'expiredTime',
                          bucket_name: 'bucketName',
                          session_token: 'sessionToken',
                          tmp_secret_id: 'secretId',
                          tmp_secret_key: 'secretKey'
                        }
                      }
                    },
                    update: null,
                    delete: null
                  }
                })(this.tim)),
                (this.config.bigDataHallwayAuthKey = (function(e) {
                  return {
                    create: null,
                    query: {
                      serverName: vp.NAME.OPEN_IM,
                      cmd: vp.CMD.BIG_DATA_HALLWAY_AUTH_KEY,
                      channel: vp.CHANNEL.XHR,
                      protocol: yp,
                      method: 'POST',
                      queryString: {
                        websdkappid: dp,
                        v: gp,
                        platform: mp,
                        sdkappid: e.loginInfo.SDKAppID,
                        accounttype: '792',
                        apn: null !== e.context ? e.context.apn : 1,
                        reqtime: function() {
                          return +new Date()
                        }
                      },
                      requestData: {}
                    }
                  }
                })(this.tim)),
                (this.config.ssoEventStat = (function(e) {
                  var t = null
                  null !== e.context &&
                    (t = { sdkappid: e.context.SDKAppID, reqtime: Math.ceil(+new Date() / 1e3) })
                  return {
                    create: {
                      serverName: vp.NAME.IM_OPEN_STAT,
                      cmd: vp.CMD.TIM_WEB_REPORT,
                      channel: vp.CHANNEL.AUTO,
                      protocol: yp,
                      queryString: t,
                      requestData: { table: '', report: [] },
                      keyMaps: {
                        request: {
                          table: 'table',
                          report: 'report',
                          SDKAppID: 'sdkappid',
                          version: 'version',
                          tinyID: 'tinyid',
                          userID: 'userid',
                          platform: 'platform',
                          method: 'method',
                          time: 'time',
                          start: 'start',
                          end: 'end',
                          cost: 'cost',
                          status: 'status',
                          codeint: 'codeint',
                          message: 'message',
                          pointer: 'pointer',
                          text: 'text',
                          msgType: 'msgtype',
                          networkType: 'networktype',
                          startts: 'startts',
                          endts: 'endts',
                          timespan: 'timespan'
                        }
                      }
                    },
                    query: {},
                    update: {},
                    delete: {}
                  }
                })(this.tim)),
                (this.config.ssoSumStat = (function(e) {
                  var t = null
                  null !== e.context &&
                    (t = { sdkappid: e.context.SDKAppID, reqtime: Math.ceil(+new Date() / 1e3) })
                  return {
                    create: {
                      serverName: vp.NAME.IM_OPEN_STAT,
                      cmd: vp.CMD.TIM_WEB_REPORT,
                      channel: vp.CHANNEL.AUTO,
                      protocol: yp,
                      queryString: t,
                      requestData: { table: '', report: [] },
                      keyMaps: {
                        request: {
                          table: 'table',
                          report: 'report',
                          SDKAppID: 'sdkappid',
                          version: 'version',
                          tinyID: 'tinyid',
                          userID: 'userid',
                          item: 'item',
                          lpID: 'lpid',
                          platform: 'platform',
                          networkType: 'networktype',
                          total: 'total',
                          successRate: 'successrate',
                          avg: 'avg',
                          timespan: 'timespan',
                          time: 'time'
                        }
                      }
                    },
                    query: {},
                    update: {},
                    delete: {}
                  }
                })(this.tim))
            }
          },
          {
            key: '_initRequestData',
            value: function(e, t) {
              if (void 0 === e) return Dp(t.requestData, this._getRequestMap(t), this.tim)
              var n = t.requestData,
                r = Object.create(null)
              for (var o in n)
                if (Object.prototype.hasOwnProperty.call(n, o)) {
                  if (((r[o] = 'function' == typeof n[o] ? n[o]() : n[o]), void 0 === e[o]))
                    continue
                  r[o] = e[o]
                }
              return (r = Dp(r, this._getRequestMap(t), this.tim))
            }
          },
          {
            key: '_getRequestMap',
            value: function(e) {
              if (e.keyMaps && e.keyMaps.request && Object.keys(e.keyMaps.request).length > 0)
                return e.keyMaps.request
            }
          },
          {
            key: '_initEncoder',
            value: function(e) {
              switch (e.protocol) {
                case yp:
                  return function(e) {
                    if ('string' === Sn(e))
                      try {
                        return JSON.parse(e)
                      } catch (kd) {
                        return e
                      }
                    return e
                  }
                case _p:
                  return function(e) {
                    return e
                  }
                default:
                  return function(e) {
                    return (
                      Gs.warn(
                        'PackageConfig._initEncoder(), unknow response type, data: ',
                        JSON.stringify(e)
                      ),
                      e
                    )
                  }
              }
            }
          },
          {
            key: '_initDecoder',
            value: function(e) {
              switch (e.protocol) {
                case yp:
                  return function(e) {
                    if ('string' === Sn(e))
                      try {
                        return JSON.parse(e)
                      } catch (kd) {
                        return e
                      }
                    return e
                  }
                case _p:
                  return function(e) {
                    return e
                  }
                default:
                  return function(e) {
                    return (
                      Gs.warn('PackageConfig._initDecoder(), unknow response type, data: ', e), e
                    )
                  }
              }
            }
          }
        ]),
        e
      )
    })(),
    rd = {
      C2CMessageArray: 1,
      groupMessageArray: 1,
      groupTips: 1,
      C2CNotifyMessageArray: 1,
      profileModify: 1,
      friendListMod: 1
    },
    od = (function(e) {
      function t(e) {
        var n
        return In(this, t), (n = Gn(this, Nn(t).call(this, e)))._initialization(), n
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initialization',
            value: function() {
              ;(this._syncOffset = ''),
                (this._syncNoticeList = []),
                (this._syncEventArray = []),
                (this._syncMessagesIsRunning = !1),
                (this._syncMessagesFinished = !1),
                (this._isLongPoll = !1),
                (this._longPollID = 0),
                (this._noticeSequence = 0),
                this._initializeListener(),
                (this._runLoop = null),
                this._initShuntChannels()
            }
          },
          {
            key: '_initShuntChannels',
            value: function() {
              ;(this._shuntChannels = Object.create(null)),
                (this._shuntChannels.C2CMessageArray = this._C2CMessageArrayChannel.bind(this)),
                (this._shuntChannels.groupMessageArray = this._groupMessageArrayChannel.bind(this)),
                (this._shuntChannels.groupTips = this._groupTipsChannel.bind(this)),
                (this._shuntChannels.C2CNotifyMessageArray = this._C2CNotifyMessageArrayChannel.bind(
                  this
                )),
                (this._shuntChannels.profileModify = this._profileModifyChannel.bind(this)),
                (this._shuntChannels.friendListMod = this._friendListModChannel.bind(this))
            }
          },
          {
            key: '_C2CMessageArrayChannel',
            value: function(e, t, n) {
              this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_NEW_C2C_NOTICE, { data: t, type: n })
            }
          },
          {
            key: '_groupMessageArrayChannel',
            value: function(e, t, n) {
              this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_NEW_GROUP_MESSAGES, { data: t })
            }
          },
          {
            key: '_groupTipsChannel',
            value: function(e, t, n) {
              var r = this
              switch (e) {
                case 4:
                  this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_NEW_GROUP_TIPS, { data: t })
                  break
                case 5:
                  t.forEach(function(e) {
                    Ks(e.elements.revokedInfos)
                      ? r.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_GROUP_MESSAGE_REVOKED, {
                          data: t
                        })
                      : r.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_NEW_GROUP_NOTICE, {
                          data: { groupSystemNotices: t, type: n }
                        })
                  })
                  break
                default:
                  Gs.warn('未知的群事件类型 Event:'.concat(e))
              }
            }
          },
          {
            key: '_C2CNotifyMessageArrayChannel',
            value: function(e, t, n) {
              this._isKickedoutNotice(t)
                ? this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_MUTIPLE_DEVICE_KICKED_OUT)
                : this._isSysCmdMsgNotify(t)
                ? this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_RECEIVE_SYSTEM_ORDERS)
                : this._isC2CMessageRevokedNotify(t) &&
                  this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_C2C_MESSAGE_REVOKED, {
                    data: t,
                    type: n
                  })
            }
          },
          {
            key: '_profileModifyChannel',
            value: function(e, t, n) {
              this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_PROFILE_MODIFIED, { data: t })
            }
          },
          {
            key: '_friendListModChannel',
            value: function(e, t, n) {
              this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_NEW_FRIEND_MESSAGES, { data: t })
            }
          },
          {
            key: '_dispatchNotice',
            value: function(e) {
              var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'poll'
              if (Ks(e))
                for (
                  var n = this.tim.innerEmitter,
                    r = null,
                    o = null,
                    i = '',
                    a = '',
                    s = '',
                    u = 0,
                    c = 0,
                    l = e.length;
                  c < l;
                  c++
                )
                  (u = (r = e[c]).event),
                    (i = Object.keys(r).find(function(e) {
                      return void 0 !== rd[e]
                    })),
                    js(this._shuntChannels[i])
                      ? ((o = r[i]),
                        'poll' === t && this._updatenoticeSequence(o),
                        this._shuntChannels[i](u, o, t))
                      : ('poll' === t && this._updatenoticeSequence(),
                        (a = ''.concat(rp.NOTICE_RUNLOOP_UNEXPECTED_CONDITION)),
                        (s = ''
                          .concat(op.NOTICE_RUNLOOP_UNEXPECTED_CONDITION, ': ')
                          .concat(u, ', ')
                          .concat(i)),
                        n.emit(
                          Sp.ERROR_DETECTED,
                          new np({ code: a, message: s, data: { payloadName: i, event: u } })
                        ),
                        (a = ''),
                        (s = ''))
            }
          },
          {
            key: 'getLongPollID',
            value: function() {
              return this._longPollID
            }
          },
          {
            key: '_IAmReady',
            value: function() {
              this.triggerReady()
            }
          },
          {
            key: 'reset',
            value: function() {
              ;(this._noticeSequence = 0), this._resetSync(), this.closeNoticeChannel()
            }
          },
          {
            key: '_resetSync',
            value: function() {
              ;(this._syncOffset = ''),
                (this._syncNoticeList = []),
                (this._syncEventArray = []),
                (this._syncMessagesIsRunning = !1),
                (this._syncMessagesFinished = !1)
            }
          },
          {
            key: '_setNoticeSeqInRequestData',
            value: function(e) {
              ;(e.Cookie.NoticeSeq = this._noticeSequence),
                this.tim.sumStatController.addTotalCount(Bp.LONG_POLLING)
            }
          },
          {
            key: '_updatenoticeSequence',
            value: function(e) {
              if (e) {
                var t = e[e.length - 1].noticeSequence
                t && 'number' == typeof t
                  ? t <= this._noticeSequence || (this._noticeSequence = t)
                  : this._noticeSequence++
              } else this._noticeSequence++
            }
          },
          {
            key: '_initializeListener',
            value: function() {
              var e = this.tim.innerEmitter
              e.on(Sp.NOTICE_LONGPOLL_RESTART, this.restartNoticeChannel, this),
                e.on(Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED, this._startSyncMessages, this),
                e.on(Sp.SYNC_MESSAGE_C2C_FINISHED, this.openNoticeChannel, this),
                e.on(Sp.SIGN_LOGOUT_SUCCESS, this.closeNoticeChannel, this),
                e.on(Sp.NOTICE_LONGPOLL_SOON_RECONNECT, this._onChannelReconnect, this),
                e.on(Sp.NOTICE_LONGPOLL_DISCONNECT, this._onChannelDisconnected, this)
            }
          },
          {
            key: 'openNoticeChannel',
            value: function() {
              Gs.log('NotificationController.openNoticeChannel'), this._getLongPollID()
            }
          },
          {
            key: 'closeNoticeChannel',
            value: function() {
              Gs.log('NotificationController.closeNoticeChannel()'),
                (this._runLoop instanceof ig || this._runLoop instanceof ag) &&
                  (this._runLoop.abort(), this._runLoop.stop()),
                (this._longPollID = 0),
                (this._isLongPoll = !1),
                this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_STOPPED)
            }
          },
          {
            key: 'restartNoticeChannel',
            value: function() {
              this.closeNoticeChannel(),
                (this._syncMessagesFinished = !1),
                this._startSyncMessages()
            }
          },
          {
            key: '_getLongPollID',
            value: function() {
              var e = this,
                t = this.tim,
                n = t.innerEmitter,
                r = t.connectionController
              if (0 === this._longPollID) {
                var o = this.createPackage({ name: 'longPollID', action: 'query' })
                r.request(o)
                  .then(function(t) {
                    t.data.errorCode === yu.REQUEST.SUCCESS
                      ? e._onGetLongPollIDSuccess({ data: t.data.longPollingID })
                      : e._onGetLongPollIDFail({ data: t.data })
                  })
                  .catch(function(e) {
                    n.emit(
                      Sp.ERROR_DETECTED,
                      new np({
                        code: rp.GET_LONGPOLL_ID_FAILED,
                        message: op.GET_LONGPOLL_ID_FAILED
                      })
                    )
                  })
              } else this._onGetLongPollIDSuccess({ data: this._longPollID })
            }
          },
          {
            key: '_onGetLongPollIDSuccess',
            value: function(e) {
              this.tim.packageConfig.set({
                key: 'long_poll_logout.query.requestData.longPollingID',
                value: e.data
              }),
                this.tim.packageConfig.set({
                  key: 'longPoll.query.requestData.cookie.longPollingID',
                  value: e.data
                }),
                (this._longPollID = e.data),
                this._startLongPoll(),
                this._IAmReady(),
                this.tim.sumStatController.recordLongPollingID(this._longPollID)
            }
          },
          {
            key: '_onGetLongPollIDFail',
            value: function(e) {
              Gs.warn('Notification._onGetLongPollIDFail', e)
            }
          },
          {
            key: '_startLongPoll',
            value: function() {
              if (!0 !== this._isLongPoll) {
                Gs.log('NotificationController._startLongPoll...')
                var e = this.tim,
                  t = e.connectionController,
                  n = e.innerEmitter,
                  r = this.createPackage({ name: 'longPoll', action: 'query' })
                ;(this._isLongPoll = !0),
                  n.emit(Sp.NOTICE_LONGPOLL_START, { data: Date.now() }),
                  (this._runLoop = t.createRunLoop({
                    pack: r,
                    before: this._setNoticeSeqInRequestData.bind(this),
                    success: this._onNoticeReceived.bind(this),
                    fail: this._onNoticeFail.bind(this)
                  })),
                  this._runLoop.start()
              } else Gs.log('NotificationController._startLongPoll is running...')
            }
          },
          {
            key: '_onChannelReconnect',
            value: function(e) {
              this.closeNoticeChannel(), this.syncMessage()
            }
          },
          { key: '_onChannelDisconnected', value: function() {} },
          {
            key: '_onNoticeReceived',
            value: function(e) {
              var t = this.tim,
                n = t.innerEmitter,
                r = t.statusController,
                o = e.data,
                i = !r.getChannelStatus()
              if (
                (n.emit(Sp.NOTICE_LONGPOLL_REQUEST_ARRIVED, { data: Date.now() }),
                o.errorCode !== yu.REQUEST.SUCCESS)
              ) {
                var a = new Hp()
                if (
                  (a.setMethod(jp.LONG_POLLING_ERROR).setStart(),
                  a
                    .setMessage(o.errorInfo)
                    .setCode(o.errorCode)
                    .setNetworkType(this.getNetworkType())
                    .setEnd(),
                  o.errorCode === rp.LONG_POLL_KICK_OUT)
                )
                  return (
                    n.emit(Sp.NOTICE_LONGPOLL_KICKED_OUT),
                    Gs.log('NotificationController._onNoticeReceived(), longPollingID was kicked'),
                    void this.closeNoticeChannel()
                  )
                n.emit(
                  Sp.NOTICE_LONGPOLL_REQUEST_ERROR,
                  new np({ code: o.errorCode, message: o.errorInfo })
                )
              }
              this.tim.sumStatController.addSuccessCount(Bp.LONG_POLLING),
                this.tim.sumStatController.addCost(Bp.LONG_POLLING, o.timecost),
                e.data.eventArray && !0 !== i && this._dispatchNotice(e.data.eventArray)
            }
          },
          {
            key: '_onNoticeFail',
            value: function(e) {
              var t = new Hp()
              t.setMethod(jp.LONG_POLLING_ERROR).setStart(),
                this.probeNetwork(function(n, r) {
                  t.setError(e.error, n, r).setEnd()
                }),
                this.tim.innerEmitter.emit(Sp.ERROR_DETECTED, e.error),
                this.tim.innerEmitter.emit(Sp.NOTICE_LONGPOLL_REQUEST_NOT_ARRIVED, {
                  data: Date.now()
                })
            }
          },
          {
            key: '_isKickedoutNotice',
            value: function(e) {
              return !!e[0].hasOwnProperty('kickoutMsgNotify')
            }
          },
          {
            key: '_isSysCmdMsgNotify',
            value: function(e) {
              if (!e[0]) return !1
              var t = e[0]
              return !!Object.prototype.hasOwnProperty.call(t, 'sysCmdMsgNotify')
            }
          },
          {
            key: '_isC2CMessageRevokedNotify',
            value: function(e) {
              var t = e[0]
              return !!Object.prototype.hasOwnProperty.call(t, 'c2cMessageRevokedNotify')
            }
          },
          {
            key: '_startSyncMessages',
            value: function(e) {
              !0 !== this._syncMessagesFinished && this.syncMessage()
            }
          },
          {
            key: 'syncMessage',
            value: function() {
              var e = this,
                t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '',
                n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
                r = this.tim,
                o = r.connectionController,
                i = r.innerEmitter
              this._syncMessagesIsRunning = !0
              var a = this.createPackage({
                name: 'syncMessage',
                action: 'query',
                param: { cookie: t, syncFlag: n }
              })
              o.request(a)
                .then(function(t) {
                  var n = t.data
                  switch (zg(n.cookie, n.syncFlag)) {
                    case '00':
                    case '01':
                      i.emit(Sp.ERROR_DETECTED, {
                        code: rp.NOTICE_RUNLOOP_OFFSET_LOST,
                        message: op.NOTICE_RUNLOOP_OFFSET_LOST
                      })
                      break
                    case '10':
                    case '11':
                      n.eventArray && e._dispatchNotice(n.eventArray, 'sync'),
                        (e._syncNoticeList = e._syncNoticeList.concat(n.messageList)),
                        i.emit(Sp.SYNC_MESSAGE_C2C_PROCESSING, {
                          data: n.messageList,
                          C2CRemainingUnreadList: n.C2CRemainingUnreadList
                        }),
                        (e._syncOffset = n.cookie),
                        e.syncMessage(n.cookie, n.syncFlag)
                      break
                    case '12':
                      n.eventArray && e._dispatchNotice(n.eventArray, 'sync'),
                        (e._syncNoticeList = e._syncNoticeList.concat(n.messageList)),
                        i.emit(Sp.SYNC_MESSAGE_C2C_FINISHED, {
                          data: n.messageList,
                          C2CRemainingUnreadList: n.C2CRemainingUnreadList
                        }),
                        (e._syncOffset = n.cookie),
                        (e._syncNoticeList = []),
                        (e._syncMessagesIsRunning = !1),
                        (e._syncMessagesFinished = !0)
                  }
                })
                .catch(function(t) {
                  ;(e._syncMessagesIsRunning = !1),
                    Gs.error(
                      'NotificationController.syncMessage() failed, error:',
                      JSON.stringify(t)
                    )
                })
            }
          }
        ]),
        t
      )
    })(wp),
    id = (function(e) {
      function t(e) {
        var n
        return In(this, t), (n = Gn(this, Nn(t).call(this, e)))._initializeListener(), n
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initializeMembers',
            value: function(e) {
              ;(this.expiredTimeLimit = 300),
                (this.appid = e.appid || ''),
                (this.bucketName = e.bucketName || ''),
                (this.ciUrl = e.ciUrl || ''),
                (this.directory = e.directory || ''),
                (this.downloadUrl = e.downloadUrl || ''),
                (this.uploadUrl = e.uploadUrl || ''),
                (this.expiredTimeOut = e.expiredTimeOut || this.expiredTimeLimit),
                (this.region = 'ap-shanghai'),
                (this.cos = null),
                (this.cosOptions = {
                  secretId: e.secretId,
                  secretKey: e.secretKey,
                  sessionToken: e.sessionToken,
                  expiredTime: e.expiredTime
                }),
                this._initUploaderMethod()
            }
          },
          {
            key: '_expiredTimer',
            value: function() {
              var e = this,
                t = setInterval(function() {
                  Math.ceil(Date.now() / 1e3) >= e.cosOptions.expiredTime - 20 &&
                    ((e._isReady = !1), e._getAuthorizationKey(), clearInterval(t))
                }, 1e4)
            }
          },
          {
            key: '_initializeListener',
            value: function() {
              this.tim.innerEmitter.on(
                Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED,
                this._initialization,
                this
              )
            }
          },
          {
            key: '_initialization',
            value: function() {
              this._initCOSSDKPlugin(),
                this.COSSDK
                  ? (this._initializeMembers({}), this._getAuthorizationKey())
                  : Gs.warn(
                      'UploadController._initialization 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin'
                    )
            }
          },
          {
            key: '_getAuthorizationKey',
            value: function() {
              var e = this,
                t = Math.ceil(Date.now() / 1e3),
                n = this.createPackage({
                  name: 'cosSig',
                  action: 'query',
                  param: { duration: this.expiredTimeLimit }
                })
              this.tim.connectionController
                .request(n)
                .then(function(n) {
                  var r = n.data.expiredTime - t
                  ;(n.data.expiredTimeOut = r),
                    Gs.log('UploadController._getAuthorizationKey timeout='.concat(r, 's')),
                    e._initializeMembers(n.data),
                    e._expiredTimer(),
                    e._initUploaderMethod()
                })
                .catch(function(e) {
                  Gs.warn('UploadController._getAuthorizationKey. error:', e)
                })
            }
          },
          {
            key: '_initCOSSDKPlugin',
            value: function() {
              var e = es ? 'cos-wx-sdk' : 'cos-js-sdk'
              this.COSSDK = this.tim.getPlugin(e)
            }
          },
          {
            key: '_initUploaderMethod',
            value: function() {
              var e = this
              this.appid &&
                ((this.cos = es
                  ? new this.COSSDK({
                      ForcePathStyle: !0,
                      getAuthorization: this._getAuthorization.bind(this)
                    })
                  : new this.COSSDK({ getAuthorization: this._getAuthorization.bind(this) })),
                (this._cosUploadMethod = es
                  ? function(t, n) {
                      e.cos.postObject(t, n)
                    }
                  : function(t, n) {
                      e.cos.uploadFiles(t, n)
                    }),
                this.triggerReady())
            }
          },
          {
            key: '_getAuthorization',
            value: function(e, t) {
              t({
                TmpSecretId: this.cosOptions.secretId,
                TmpSecretKey: this.cosOptions.secretKey,
                XCosSecurityToken: this.cosOptions.sessionToken,
                ExpiredTime: this.cosOptions.expiredTime
              })
            }
          },
          {
            key: 'uploadImage',
            value: function(e) {
              if (!e.file)
                return Kp(
                  new np({
                    code: rp.MESSAGE_IMAGE_SELECT_FILE_FIRST,
                    message: op.MESSAGE_IMAGE_SELECT_FILE_FIRST
                  })
                )
              var t = this._checkImageType(e.file)
              if (!0 !== t) return t
              var n = this._checkImageMime(e.file)
              if (!0 !== n) return n
              var r = this._checkImageSize(e.file)
              return !0 !== r ? r : this.upload(e)
            }
          },
          {
            key: '_checkImageType',
            value: function(e) {
              var t = ''
              return (
                (t = es
                  ? e.url.slice(e.url.lastIndexOf('.') + 1)
                  : e.files[0].name.slice(e.files[0].name.lastIndexOf('.') + 1)),
                ip.indexOf(t.toLowerCase()) >= 0 ||
                  Kp(
                    new np({
                      coe: rp.MESSAGE_IMAGE_TYPES_LIMIT,
                      message: op.MESSAGE_IMAGE_TYPES_LIMIT
                    })
                  )
              )
            }
          },
          {
            key: '_checkImageMime',
            value: function(e) {
              return !0
            }
          },
          {
            key: '_checkImageSize',
            value: function(e) {
              var t = 0
              return 0 === (t = es ? e.size : e.files[0].size)
                ? Kp(
                    new np({
                      code: rp.MESSAGE_FILE_IS_EMPTY,
                      message: ''.concat(op.MESSAGE_FILE_IS_EMPTY)
                    })
                  )
                : t < 20971520 ||
                    Kp(
                      new np({
                        coe: rp.MESSAGE_IMAGE_SIZE_LIMIT,
                        message: ''.concat(op.MESSAGE_IMAGE_SIZE_LIMIT)
                      })
                    )
            }
          },
          {
            key: 'uploadFile',
            value: function(e) {
              var t = null
              return e.file
                ? e.file.files[0].size > 104857600
                  ? ((t = new np({
                      code: rp.MESSAGE_FILE_SIZE_LIMIT,
                      message: op.MESSAGE_FILE_SIZE_LIMIT
                    })),
                    Kp(t))
                  : 0 === e.file.files[0].size
                  ? ((t = new np({
                      code: rp.MESSAGE_FILE_IS_EMPTY,
                      message: ''.concat(op.MESSAGE_FILE_IS_EMPTY)
                    })),
                    Kp(t))
                  : this.upload(e)
                : ((t = new np({
                    code: rp.MESSAGE_FILE_SELECT_FILE_FIRST,
                    message: op.MESSAGE_FILE_SELECT_FILE_FIRST
                  })),
                  Kp(t))
            }
          },
          {
            key: 'uploadVideo',
            value: function(e) {
              if (es)
                return e.file.videoFile.size > 20971520
                  ? Kp(
                      new np({
                        code: rp.MESSAGE_VIDEO_SIZE_LIMIT,
                        message: ''.concat(op.MESSAGE_VIDEO_SIZE_LIMIT)
                      })
                    )
                  : 0 === e.file.videoFile.size
                  ? Kp(
                      new np({
                        code: rp.MESSAGE_FILE_IS_EMPTY,
                        message: ''.concat(op.MESSAGE_FILE_IS_EMPTY)
                      })
                    )
                  : -1 === ap.indexOf(e.file.videoFile.type)
                  ? Kp(
                      new np({
                        code: rp.MESSAGE_VIDEO_TYPES_LIMIT,
                        message: ''.concat(op.MESSAGE_VIDEO_TYPES_LIMIT)
                      })
                    )
                  : this.handleVideoUpload({ file: e.file.videoFile })
            }
          },
          {
            key: 'handleVideoUpload',
            value: function(e) {
              var t = this
              return new Promise(function(n, r) {
                t.upload(e)
                  .then(function(e) {
                    n(e)
                  })
                  .catch(function() {
                    t.upload(e)
                      .then(function(e) {
                        n(e)
                      })
                      .catch(function() {
                        r(
                          new np({
                            code: rp.MESSAGE_VIDEO_UPLOAD_FAIL,
                            message: op.MESSAGE_VIDEO_UPLOAD_FAIL
                          })
                        )
                      })
                  })
              })
            }
          },
          {
            key: 'uploadAudio',
            value: function(e) {
              return e.file
                ? e.file.size > 20971520
                  ? Kp(
                      new np({
                        code: rp.MESSAGE_AUDIO_SIZE_LIMIT,
                        message: ''.concat(op.MESSAGE_AUDIO_SIZE_LIMIT)
                      })
                    )
                  : 0 === e.file.size
                  ? Kp(
                      new np({
                        code: rp.MESSAGE_FILE_IS_EMPTY,
                        message: ''.concat(op.MESSAGE_FILE_IS_EMPTY)
                      })
                    )
                  : this.upload(e)
                : Kp(
                    new np({
                      code: rp.MESSAGE_AUDIO_UPLOAD_FAIL,
                      message: op.MESSAGE_AUDIO_UPLOAD_FAIL
                    })
                  )
            }
          },
          {
            key: 'upload',
            value: function(e) {
              var t = this
              if (!js(this._cosUploadMethod))
                return (
                  Gs.warn(
                    'UploadController.upload 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin'
                  ),
                  Kp(new np({ code: rp.COS_UNDETECTED, message: op.COS_UNDETECTED }))
                )
              var n = new Hp()
              n.setMethod(jp.UPLOAD).setStart(), Gs.time(Bp.UPLOAD)
              var r = es ? e.file : e.file.files[0]
              return new Promise(function(o, i) {
                var a = es ? t._createCosOptionsWXMiniApp(e) : t._createCosOptionsWeb(e),
                  s = t
                t._cosUploadMethod(a, function(e, a) {
                  var u = Object.create(null)
                  if (a) {
                    if (t._isUploadError(a, e))
                      return (
                        i(a.files[0].error),
                        Gs.warn(
                          'UploadController.upload failed, network error:'.concat(
                            a.files[0].error.error
                          )
                        ),
                        void n
                          .setCode(rp.MESSAGE_FILE_UPLOAD_FAIL)
                          .setMessage(op.MESSAGE_FILE_UPLOAD_FAIL)
                          .setEnd()
                      )
                    ;(u.fileName = r.name),
                      (u.fileSize = r.size),
                      (u.fileType = r.type.slice(r.type.indexOf('/') + 1).toLowerCase()),
                      (u.location = es ? a.Location : a.files[0].data.Location)
                    var c = Gs.timeEnd(Bp.UPLOAD),
                      l = s._formatFileSize(r.size),
                      p = s._formatSpeed((1e3 * r.size) / c),
                      h = 'size='
                        .concat(l, ',time=')
                        .concat(c, 'ms,speed=')
                        .concat(p)
                    return (
                      Gs.log('UploadController.upload success name='.concat(r.name, ',').concat(h)),
                      o(u),
                      void n
                        .setCode(0)
                        .setNetworkType(t.getNetworkType())
                        .setText(h)
                        .setEnd()
                    )
                  }
                  n
                    .setCode(rp.MESSAGE_FILE_UPLOAD_FAIL)
                    .setMessage(op.MESSAGE_FILE_UPLOAD_FAIL)
                    .setEnd(),
                    Gs.warn('UploadController.upload failed, error:'.concat(e)),
                    i(e)
                })
              })
            }
          },
          {
            key: '_isUploadError',
            value: function(e, t) {
              return es ? !!t : null !== e.files[0].error
            }
          },
          {
            key: '_formatFileSize',
            value: function(e) {
              return e < 1024
                ? e + 'B'
                : e < 1048576
                ? Math.floor(e / 1024) + 'KB'
                : Math.floor(e / 1048576) + 'MB'
            }
          },
          {
            key: '_formatSpeed',
            value: function(e) {
              return e <= 1048576
                ? (e / 1024).toFixed(1) + 'KB/s'
                : (e / 1048576).toFixed(1) + 'MB/s'
            }
          },
          {
            key: '_createCosOptionsWeb',
            value: function(e) {
              var t = this.tim.context.identifier,
                n = this._genFileName(t, e.to, e.file.files[0].name)
              return {
                files: [
                  {
                    Bucket: ''.concat(this.bucketName, '-').concat(this.appid),
                    Region: this.region,
                    Key: ''.concat(this.directory, '/').concat(n),
                    Body: e.file.files[0]
                  }
                ],
                SliceSize: 1048576,
                onProgress: function(t) {
                  if ('function' == typeof e.onProgress)
                    try {
                      e.onProgress(t.percent)
                    } catch (n) {
                      Gs.warn('onProgress callback error:'), Gs.error(n)
                    }
                },
                onFileFinish: function(e, t, n) {}
              }
            }
          },
          {
            key: '_createCosOptionsWXMiniApp',
            value: function(e) {
              var t = this.tim.context.identifier,
                n = this._genFileName(t, e.to, e.file.name),
                r = e.file.url
              return {
                Bucket: ''.concat(this.bucketName, '-').concat(this.appid),
                Region: this.region,
                Key: ''.concat(this.directory, '/').concat(n),
                FilePath: r,
                onProgress: function(t) {
                  if ((Gs.log(JSON.stringify(t)), 'function' == typeof e.onProgress))
                    try {
                      e.onProgress(t.percent)
                    } catch (n) {
                      Gs.warn('onProgress callback error:'), Gs.error(n)
                    }
                }
              }
            }
          },
          {
            key: '_genFileName',
            value: function(e, t, n) {
              return ''
                .concat(e, '-')
                .concat(t, '-')
                .concat(tu(99999), '-')
                .concat(n)
            }
          }
        ]),
        t
      )
    })(wp),
    ad = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).FILETYPE = { SOUND: 2106, FILE: 2107, VIDEO: 2113 }),
          (n._bdh_download_server = 'grouptalk.c2c.qq.com'),
          (n._BDHBizID = 10001),
          (n._authKey = ''),
          (n._expireTime = 0),
          n.tim.innerEmitter.on(Sp.CONTEXT_A2KEY_AND_TINYID_UPDATED, n._getAuthKey, kn(n)),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_getAuthKey',
            value: function() {
              var e = this,
                t = this.createPackage({ name: 'bigDataHallwayAuthKey', action: 'query' })
              this.tim.connectionController.request(t).then(function(t) {
                t.data.authKey &&
                  ((e._authKey = t.data.authKey), (e._expireTime = parseInt(t.data.expireTime)))
              })
            }
          },
          {
            key: '_isFromOlderVersion',
            value: function(e) {
              return 2 !== e.content.downloadFlag
            }
          },
          {
            key: 'parseElements',
            value: function(e, t) {
              if (!Ks(e) || !t) return []
              for (var n = [], r = null, o = 0; o < e.length; o++)
                (r = e[o]), this._needParse(r) ? n.push(this._parseElement(r, t)) : n.push(e[o])
              return n
            }
          },
          {
            key: '_needParse',
            value: function(e) {
              return !(
                !this._isFromOlderVersion(e) ||
                (e.type !== an.MSG_AUDIO && e.type !== an.MSG_FILE && e.type !== an.MSG_VIDEO)
              )
            }
          },
          {
            key: '_parseElement',
            value: function(e, t) {
              switch (e.type) {
                case an.MSG_AUDIO:
                  return this._parseAudioElement(e, t)
                case an.MSG_FILE:
                  return this._parseFileElement(e, t)
                case an.MSG_VIDEO:
                  return this._parseVideoElement(e, t)
              }
            }
          },
          {
            key: '_parseAudioElement',
            value: function(e, t) {
              return (e.content.url = this._genAudioUrl(e.content.uuid, t)), e
            }
          },
          {
            key: '_parseFileElement',
            value: function(e, t) {
              return (e.content.url = this._genFileUrl(e.content.uuid, t, e.content.fileName)), e
            }
          },
          {
            key: '_parseVideoElement',
            value: function(e, t) {
              return (e.content.url = this._genVideoUrl(e.content.uuid, t)), e
            }
          },
          {
            key: '_genAudioUrl',
            value: function(e, t) {
              return '' === this._authKey
                ? (Gs.warn('BigDataHallwayController._genAudioUrl no authKey!'), '')
                : 'https://'
                    .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                    .concat(this._authKey, '&bid=')
                    .concat(this._BDHBizID, '&subbid=')
                    .concat(this.tim.context.SDKAppID, '&fileid=')
                    .concat(e, '&filetype=')
                    .concat(this.FILETYPE.SOUND, '&openid=')
                    .concat(t, '&ver=0')
            }
          },
          {
            key: '_genFileUrl',
            value: function(e, t, n) {
              return '' === this._authKey
                ? (Gs.warn('BigDataHallwayController._genFileUrl no authKey!'), '')
                : (n || (n = ''.concat(Math.floor(1e5 * Math.random()), '-').concat(Date.now())),
                  'https://'
                    .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                    .concat(this._authKey, '&bid=')
                    .concat(this._BDHBizID, '&subbid=')
                    .concat(this.tim.context.SDKAppID, '&fileid=')
                    .concat(e, '&filetype=')
                    .concat(this.FILETYPE.FILE, '&openid=')
                    .concat(t, '&ver=0&filename=')
                    .concat(encodeURIComponent(n)))
            }
          },
          {
            key: '_genVideoUrl',
            value: function(e, t) {
              return '' === this._authKey
                ? (Gs.warn('BigDataHallwayController._genVideoUrl no authKey!'), '')
                : 'https://'
                    .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                    .concat(this._authKey, '&bid=')
                    .concat(this._BDHBizID, '&subbid=')
                    .concat(this.tim.context.SDKAppID, '&fileid=')
                    .concat(e, '&filetype=')
                    .concat(this.FILETYPE.VIDEO, '&openid=')
                    .concat(t, '&ver=0')
            }
          },
          {
            key: 'reset',
            value: function() {
              ;(this._authKey = ''), (this.expireTime = 0)
            }
          }
        ]),
        t
      )
    })(wp),
    sd = {
      app_id: '',
      event_id: '',
      api_base: 'https://pingtas.qq.com/pingd',
      prefix: '_mta_',
      version: '1.3.9',
      stat_share_app: !1,
      stat_pull_down_fresh: !1,
      stat_reach_bottom: !1,
      stat_param: !0
    }
  function ud() {
    try {
      var e = 's' + cd()
      return wx.setStorageSync(sd.prefix + 'ssid', e), e
    } catch (t) {}
  }
  function cd(e) {
    for (var t = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], n = 10; 1 < n; n--) {
      var r = Math.floor(10 * Math.random()),
        o = t[r]
      ;(t[r] = t[n - 1]), (t[n - 1] = o)
    }
    for (n = r = 0; 5 > n; n++) r = 10 * r + t[n]
    return (e || '') + (r + '') + +new Date()
  }
  function ld() {
    try {
      var e = getCurrentPages(),
        t = '/'
      return 0 < e.length && (t = e.pop().__route__), t
    } catch (n) {
      console.log('get current page path error:' + n)
    }
  }
  function pd() {
    var e,
      t = {
        dm: 'wechat.apps.xx',
        url: encodeURIComponent(ld() + gd(dd.Data.pageQuery)),
        pvi: '',
        si: '',
        ty: 0
      }
    return (
      (t.pvi =
        ((e = (function() {
          try {
            return wx.getStorageSync(sd.prefix + 'auid')
          } catch (t) {}
        })()) ||
          ((e = (function() {
            try {
              var t = cd()
              return wx.setStorageSync(sd.prefix + 'auid', t), t
            } catch (e) {}
          })()),
          (t.ty = 1)),
        e)),
      (t.si = (function() {
        var e = (function() {
          try {
            return wx.getStorageSync(sd.prefix + 'ssid')
          } catch (e) {}
        })()
        return e || (e = ud()), e
      })()),
      t
    )
  }
  function hd() {
    var e = (function() {
      var e = wx.getSystemInfoSync()
      return {
        adt: encodeURIComponent(e.model),
        scl: e.pixelRatio,
        scr: e.windowWidth + 'x' + e.windowHeight,
        lg: e.language,
        fl: e.version,
        jv: encodeURIComponent(e.system),
        tz: encodeURIComponent(e.platform)
      }
    })()
    return (
      (function(e) {
        wx.getNetworkType({
          success: function(t) {
            e(t.networkType)
          }
        })
      })(function(e) {
        try {
          wx.setStorageSync(sd.prefix + 'ntdata', e)
        } catch (t) {}
      }),
      (e.ct = wx.getStorageSync(sd.prefix + 'ntdata') || '4g'),
      e
    )
  }
  function fd() {
    var e,
      t = dd.Data.userInfo,
      n = []
    for (e in t) t.hasOwnProperty(e) && n.push(e + '=' + t[e])
    return (
      (t = n.join(';')),
      {
        r2: sd.app_id,
        r4: 'wx',
        ext: 'v=' + sd.version + (null !== t && '' !== t ? ';ui=' + encodeURIComponent(t) : '')
      }
    )
  }
  function gd(e) {
    if (!sd.stat_param || !e) return ''
    e = (function(e) {
      if (1 > sd.ignore_params.length) return e
      var t,
        n = {}
      for (t in e) 0 <= sd.ignore_params.indexOf(t) || (n[t] = e[t])
      return n
    })(e)
    var t,
      n = []
    for (t in e) n.push(t + '=' + e[t])
    return 0 < n.length ? '?' + n.join('&') : ''
  }
  var dd = {
      App: {
        init: function(e) {
          'appID' in e && (sd.app_id = e.appID),
            'eventID' in e && (sd.event_id = e.eventID),
            'statShareApp' in e && (sd.stat_share_app = e.statShareApp),
            'statPullDownFresh' in e && (sd.stat_pull_down_fresh = e.statPullDownFresh),
            'statReachBottom' in e && (sd.stat_reach_bottom = e.statReachBottom),
            'ignoreParams' in e && (sd.ignore_params = e.ignoreParams),
            'statParam' in e && (sd.stat_param = e.statParam),
            ud()
          try {
            'lauchOpts' in e && ((dd.Data.lanchInfo = e.lauchOpts), (dd.Data.lanchInfo.landing = 1))
          } catch (t) {}
          'autoReport' in e &&
            e.autoReport &&
            (function() {
              var e = Page
              Page = function(t) {
                var n = t.onLoad
                ;(t.onLoad = function(e) {
                  n && n.call(this, e),
                    (dd.Data.lastPageQuery = dd.Data.pageQuery),
                    (dd.Data.pageQuery = e),
                    (dd.Data.lastPageUrl = dd.Data.pageUrl),
                    (dd.Data.pageUrl = ld()),
                    (dd.Data.show = !1),
                    dd.Page.init()
                }),
                  e(t)
              }
            })()
        }
      },
      Page: {
        init: function() {
          var e,
            t = getCurrentPages()[getCurrentPages().length - 1]
          t.onShow &&
            ((e = t.onShow),
            (t.onShow = function() {
              if (!0 === dd.Data.show) {
                var t = dd.Data.lastPageQuery
                ;(dd.Data.lastPageQuery = dd.Data.pageQuery),
                  (dd.Data.pageQuery = t),
                  (dd.Data.lastPageUrl = dd.Data.pageUrl),
                  (dd.Data.pageUrl = ld())
              }
              ;(dd.Data.show = !0), dd.Page.stat(), e.apply(this, arguments)
            })),
            sd.stat_pull_down_fresh &&
              t.onPullDownRefresh &&
              (function() {
                var e = t.onPullDownRefresh
                t.onPullDownRefresh = function() {
                  dd.Event.stat(sd.prefix + 'pulldownfresh', { url: t.__route__ }),
                    e.apply(this, arguments)
                }
              })(),
            sd.stat_reach_bottom &&
              t.onReachBottom &&
              (function() {
                var e = t.onReachBottom
                t.onReachBottom = function() {
                  dd.Event.stat(sd.prefix + 'reachbottom', { url: t.__route__ }),
                    e.apply(this, arguments)
                }
              })(),
            sd.stat_share_app &&
              t.onShareAppMessage &&
              (function() {
                var e = t.onShareAppMessage
                t.onShareAppMessage = function() {
                  return (
                    dd.Event.stat(sd.prefix + 'shareapp', { url: t.__route__ }),
                    e.apply(this, arguments)
                  )
                }
              })()
        },
        multiStat: function(e, t) {
          if (1 == t) dd.Page.stat(e)
          else {
            var n = getCurrentPages()[getCurrentPages().length - 1]
            n.onShow &&
              (function() {
                var t = n.onShow
                n.onShow = function() {
                  dd.Page.stat(e), t.call(this, arguments)
                }
              })()
          }
        },
        stat: function(e) {
          if ('' != sd.app_id) {
            var t = [],
              n = fd()
            if ((e && (n.r2 = e), (e = [pd(), n, hd()]), dd.Data.lanchInfo)) {
              e.push({ ht: dd.Data.lanchInfo.scene }),
                dd.Data.pageQuery &&
                  dd.Data.pageQuery._mta_ref_id &&
                  e.push({ rarg: dd.Data.pageQuery._mta_ref_id })
              try {
                1 == dd.Data.lanchInfo.landing &&
                  ((n.ext += ';lp=1'), (dd.Data.lanchInfo.landing = 0))
              } catch (i) {}
            }
            e.push({
              rdm: '/',
              rurl:
                0 >= dd.Data.lastPageUrl.length
                  ? dd.Data.pageUrl + gd(dd.Data.lastPageQuery)
                  : encodeURIComponent(dd.Data.lastPageUrl + gd(dd.Data.lastPageQuery))
            }),
              e.push({ rand: +new Date() }),
              (n = 0)
            for (var r = e.length; n < r; n++)
              for (var o in e[n])
                e[n].hasOwnProperty(o) && t.push(o + '=' + (void 0 === e[n][o] ? '' : e[n][o]))
            wx.request({ url: sd.api_base + '?' + t.join('&').toLowerCase() })
          }
        }
      },
      Event: {
        stat: function(e, t) {
          if ('' != sd.event_id) {
            var n = [],
              r = pd(),
              o = fd()
            ;(r.dm = 'wxapps.click'), (r.url = e), (o.r2 = sd.event_id)
            var i,
              a = void 0 === t ? {} : t,
              s = []
            for (i in a)
              a.hasOwnProperty(i) && s.push(encodeURIComponent(i) + '=' + encodeURIComponent(a[i]))
            for (
              a = s.join(';'),
                o.r5 = a,
                a = 0,
                o = (r = [r, o, hd(), { rand: +new Date() }]).length;
              a < o;
              a++
            )
              for (var u in r[a])
                r[a].hasOwnProperty(u) && n.push(u + '=' + (void 0 === r[a][u] ? '' : r[a][u]))
            wx.request({ url: sd.api_base + '?' + n.join('&').toLowerCase() })
          }
        }
      },
      Data: {
        userInfo: null,
        lanchInfo: null,
        pageQuery: null,
        lastPageQuery: null,
        pageUrl: '',
        lastPageUrl: '',
        show: !1
      }
    },
    md = dd,
    _d = (function() {
      function e() {
        In(this, e), (this.cache = []), (this.MtaWX = null), this._init()
      }
      return (
        Tn(e, [
          {
            key: 'report',
            value: function(e, t) {
              var n = this
              try {
                Za
                  ? window.MtaH5
                    ? (window.MtaH5.clickStat(e, t),
                      this.cache.forEach(function(e) {
                        var t = e.name,
                          r = e.param
                        window.MtaH5.clickStat(t, r), n.cache.shift()
                      }))
                    : this.cache.push({ name: e, param: t })
                  : es &&
                    (this.MtaWX
                      ? (this.MtaWX.Event.stat(e, t),
                        this.cache.forEach(function(e) {
                          var t = e.name,
                            r = e.param
                          n.MtaWX.stat(t, r), n.cache.shift()
                        }))
                      : this.cache.push({ name: e, param: t }))
              } catch (kd) {}
            }
          },
          {
            key: 'stat',
            value: function() {
              try {
                Za && window.MtaH5 ? window.MtaH5.pgv() : es && this.MtaWX && this.MtaWX.Page.stat()
              } catch (kd) {}
            }
          },
          {
            key: '_init',
            value: function() {
              try {
                if (Za) {
                  window._mtac = { autoReport: 0 }
                  var e = document.createElement('script'),
                    t = au()
                  ;(e.src = ''.concat(t, '//pingjs.qq.com/h5/stats.js?v2.0.4')),
                    e.setAttribute('name', 'MTAH5'),
                    e.setAttribute('sid', '500690998'),
                    e.setAttribute('cid', '500691017')
                  var n = document.getElementsByTagName('script')[0]
                  n.parentNode.insertBefore(e, n)
                } else
                  es &&
                    ((this.MtaWX = md),
                    this.MtaWX.App.init({
                      appID: '500690995',
                      eventID: '500691014',
                      autoReport: !1,
                      statParam: !0
                    }))
              } catch (kd) {}
            }
          }
        ]),
        e
      )
    })(),
    yd = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).tim = e),
          (n.MTA = new _d()),
          n._initListener(),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_initListener',
            value: function() {
              var e = this
              this.tim.innerEmitter.on(Sp.SDK_READY, function() {
                e.MTA.report('sdkappid', { value: e.tim.context.SDKAppID }),
                  e.MTA.report('version', { value: Pd.VERSION }),
                  e.MTA.stat()
              })
            }
          }
        ]),
        t
      )
    })(wp),
    vd = (function() {
      function e(t) {
        In(this, e), (this._table = 'timwebii'), (this._report = [])
      }
      return (
        Tn(e, [
          {
            key: 'pushIn',
            value: function(e) {
              Gs.debug('SSOLogBody.pushIn', this._report.length, e), this._report.push(e)
            }
          },
          {
            key: 'backfill',
            value: function(e) {
              var t
              Ks(e) &&
                0 !== e.length &&
                (Gs.debug('SSOLogBody.backfill', this._report.length, e.length),
                (t = this._report).unshift.apply(t, bn(e)))
            }
          },
          {
            key: 'getLogsNumInMemory',
            value: function() {
              return this._report.length
            }
          },
          {
            key: 'isEmpty',
            value: function() {
              return 0 === this._report.length
            }
          },
          {
            key: '_reset',
            value: function() {
              ;(this._report.length = 0), (this._report = [])
            }
          },
          {
            key: 'getTable',
            value: function() {
              return this._table
            }
          },
          {
            key: 'getLogsInMemory',
            value: function() {
              var e = this._report.slice()
              return this._reset(), e
            }
          }
        ]),
        e
      )
    })(),
    Ed = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).TAG = 'im-ssolog-event'),
          (n._reportBody = new vd()),
          (n._version = rn),
          (n.MIN_THRESHOLD = 20),
          (n.MAX_THRESHOLD = 100),
          (n.WAITING_TIME = 6e4),
          (n.INTERVAL = 2e4),
          (n._timerID = 0),
          n._resetLastReportTime(),
          n._startReportTimer(),
          (n._retryCount = 0),
          (n.MAX_RETRY_COUNT = 3),
          n.tim.innerEmitter.on(Sp.SIGN_LOGIN_SUCCESS, n._onLoginSuccess, kn(n)),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: 'reportAtOnce',
            value: function() {
              Gs.debug('EventStatController.reportAtOnce'), this._report()
            }
          },
          {
            key: '_onLoginSuccess',
            value: function() {
              var e = this,
                t = this.tim.storage,
                n = t.getItem(this.TAG, !1)
              gu(n) ||
                (Gs.log(
                  'EventStatController._onLoginSuccess get ssolog in storage, nums=' + n.length
                ),
                n.forEach(function(t) {
                  e._reportBody.pushIn(t)
                }),
                t.removeItem(this.TAG, !1))
            }
          },
          {
            key: 'pushIn',
            value: function(e) {
              e instanceof Hp &&
                (e.setCommonInfo(
                  this.tim.context.SDKAppID,
                  this._version,
                  this.tim.context.tinyID,
                  this.tim.loginInfo.identifier,
                  this.getPlatform()
                ),
                this._reportBody.pushIn(e),
                this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD && this._report())
            }
          },
          {
            key: '_resetLastReportTime',
            value: function() {
              this._lastReportTime = Date.now()
            }
          },
          {
            key: '_startReportTimer',
            value: function() {
              var e = this
              this._timerID = setInterval(function() {
                Date.now() < e._lastReportTime + e.WAITING_TIME ||
                  e._reportBody.isEmpty() ||
                  e._report()
              }, this.INTERVAL)
            }
          },
          {
            key: '_stopReportTimer',
            value: function() {
              this._timerID > 0 && (clearInterval(this._timerID), (this._timerID = 0))
            }
          },
          {
            key: '_report',
            value: function() {
              var e = this
              if (!this._reportBody.isEmpty()) {
                var t = this._reportBody.getLogsInMemory(),
                  n = this.createPackage({
                    name: 'ssoEventStat',
                    action: 'create',
                    param: { table: this._reportBody.getTable(), report: t }
                  })
                this.tim.connectionController
                  .request(n)
                  .then(function() {
                    e._resetLastReportTime(),
                      e._retryCount > 0 &&
                        (Gs.debug('EventStatController.report retry success'), (e._retryCount = 0))
                  })
                  .catch(function(n) {
                    if (
                      (Gs.warn(
                        'EventStatController.report, online:'.concat(e.getNetworkType(), ' error:'),
                        n
                      ),
                      e._reportBody.backfill(t),
                      e._reportBody.getLogsNumInMemory() > e.MAX_THRESHOLD ||
                        e._retryCount === e.MAX_RETRY_COUNT ||
                        0 === e._timerID)
                    )
                      return (e._retryCount = 0), void e._flushAtOnce()
                    e._retryCount += 1
                  })
              }
            }
          },
          {
            key: '_flushAtOnce',
            value: function() {
              var e = this.tim.storage,
                t = e.getItem(this.TAG, !1),
                n = this._reportBody.getLogsInMemory()
              if (gu(t))
                Gs.log('EventStatController._flushAtOnce nums=' + n.length),
                  e.setItem(this.TAG, n, !0, !1)
              else {
                var r = n.concat(t)
                r.length > this.MAX_THRESHOLD && (r = r.slice(0, this.MAX_THRESHOLD)),
                  Gs.log('EventStatController._flushAtOnce nums=' + r.length),
                  e.setItem(this.TAG, r, !0, !1)
              }
            }
          },
          {
            key: 'reset',
            value: function() {
              Gs.log('EventStatController.reset'), this._stopReportTimer(), this._report()
            }
          }
        ]),
        t
      )
    })(wp),
    Sd = 'none',
    Id = 'online',
    Cd = (function() {
      function e() {
        In(this, e), (this._networkType = ''), (this.maxWaitTime = 3e3)
      }
      return (
        Tn(e, [
          {
            key: 'start',
            value: function() {
              var e = this
              es
                ? (wx.getNetworkType({
                    success: function(t) {
                      ;(e._networkType = t.networkType),
                        t.networkType === Sd
                          ? Gs.warn('NetMonitor no network, please check!')
                          : Gs.info('NetMonitor networkType:'.concat(t.networkType))
                    }
                  }),
                  wx.onNetworkStatusChange(this._onWxNetworkStatusChange.bind(this)))
                : (this._networkType = Id)
            }
          },
          {
            key: '_onWxNetworkStatusChange',
            value: function(e) {
              ;(this._networkType = e.networkType),
                e.isConnected
                  ? Gs.info('NetMonitor networkType:'.concat(e.networkType))
                  : Gs.warn('NetMonitor no network, please check!')
            }
          },
          {
            key: 'probe',
            value: function() {
              var e = this
              return new Promise(function(t, n) {
                if (es)
                  wx.getNetworkType({
                    success: function(n) {
                      ;(e._networkType = n.networkType),
                        n.networkType === Sd
                          ? (Gs.warn('NetMonitor no network, please check!'), t(!1, n.networkType))
                          : (Gs.info('NetMonitor networkType:'.concat(n.networkType)),
                            t(!0, n.networkType))
                    }
                  })
                else if (window && window.fetch)
                  fetch(
                    ''
                      .concat(
                        au(),
                        '//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random='
                      )
                      .concat(Math.random())
                  )
                    .then(function(e) {
                      e.ok ? t(!0, Id) : t(!1, Sd)
                    })
                    .catch(function(e) {
                      t(!1, Sd)
                    })
                else {
                  var r = new XMLHttpRequest(),
                    o = setTimeout(function() {
                      Gs.warn('NetMonitor fetch timeout. Probably no network, please check!'),
                        r.abort(),
                        (e._networkType = Sd),
                        t(!1, Sd)
                    }, e.maxWaitTime)
                  ;(r.onreadystatechange = function() {
                    4 === r.readyState &&
                      (clearTimeout(o),
                      200 === r.status || 304 === r.status
                        ? ((this._networkType = Id), t(!0, Id))
                        : (Gs.warn(
                            'NetMonitor fetch status:'.concat(
                              r.status,
                              '. Probably no network, please check!'
                            )
                          ),
                          (this._networkType = Sd),
                          t(!1, Sd)))
                  }),
                    r.open(
                      'GET',
                      ''
                        .concat(
                          au(),
                          '//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random='
                        )
                        .concat(Math.random())
                    ),
                    r.send()
                }
              })
            }
          },
          {
            key: 'getNetworkType',
            value: function() {
              return this._networkType
            }
          },
          {
            key: 'reset',
            value: function() {
              this._networkType = ''
            }
          }
        ]),
        e
      )
    })(),
    Td = (function() {
      function e(t) {
        var n = this
        In(this, e),
          Ks(t)
            ? ((this._map = new Map()),
              t.forEach(function(e) {
                n._map.set(e, [])
              }))
            : Gs.warn('AverageCalculator.constructor need keys')
      }
      return (
        Tn(e, [
          {
            key: 'push',
            value: function(e, t) {
              return !(Bs(e) || !this._map.has(e) || !xs(t)) && (this._map.get(e).push(t), !0)
            }
          },
          {
            key: 'getSize',
            value: function(e) {
              return Bs(e) || !this._map.has(e) ? -1 : this._map.get(e).length
            }
          },
          {
            key: 'getAvg',
            value: function(e) {
              if (Bs(e) || !this._map.has(e)) return -1
              var t = this._map.get(e),
                n = t.length
              if (0 === n) return 0
              var r = 0
              return (
                t.forEach(function(e) {
                  r += e
                }),
                (t.length = 0),
                this._map.set(e, []),
                parseInt(r / n)
              )
            }
          },
          {
            key: 'getMax',
            value: function(e) {
              return Bs(e) || !this._map.has(e) ? -1 : Math.max.apply(null, this._map.get(e))
            }
          },
          {
            key: 'getMin',
            value: function(e) {
              return Bs(e) || !this._map.has(e) ? -1 : Math.min.apply(null, this._map.get(e))
            }
          },
          {
            key: 'reset',
            value: function() {
              this._map.forEach(function(e) {
                e.length = 0
              })
            }
          }
        ]),
        e
      )
    })(),
    Md = (function() {
      function e(t) {
        var n = this
        In(this, e),
          Ks(t)
            ? ((this._map = new Map()),
              t.forEach(function(e) {
                n._map.set(e, { totalCount: 0, successCount: 0 })
              }))
            : Gs.warn('SuccessRateCalculator.constructor need keys')
      }
      return (
        Tn(e, [
          {
            key: 'addTotalCount',
            value: function(e) {
              return !(Bs(e) || !this._map.has(e)) && ((this._map.get(e).totalCount += 1), !0)
            }
          },
          {
            key: 'addSuccessCount',
            value: function(e) {
              return !(Bs(e) || !this._map.has(e)) && ((this._map.get(e).successCount += 1), !0)
            }
          },
          {
            key: 'getSuccessRate',
            value: function(e) {
              if (Bs(e) || !this._map.has(e)) return -1
              var t = this._map.get(e)
              if (0 === t.totalCount) return 1
              var n = parseFloat((t.successCount / t.totalCount).toFixed(2))
              return (t.totalCount = t.successCount = 0), n
            }
          },
          {
            key: 'getTotalCount',
            value: function(e) {
              return Bs(e) || !this._map.has(e) ? -1 : this._map.get(e).totalCount
            }
          },
          {
            key: 'reset',
            value: function() {
              this._map.forEach(function(e) {
                ;(e.totalCount = 0), (e.successCount = 0)
              })
            }
          }
        ]),
        e
      )
    })(),
    Od = (function(e) {
      function t(e) {
        var n
        return (
          In(this, t),
          ((n = Gn(this, Nn(t).call(this, e))).TABLE = 'timwebsum'),
          (n.TAG = 'im-ssolog-sumstat'),
          (n._items = [Bp.LONG_POLLING, Bp.LONG_POLLING_AV, Bp.SEND_MESSAGE]),
          (n._thresholdMap = new Map()),
          n._thresholdMap.set(Bp.LONG_POLLING, 100),
          n._thresholdMap.set(Bp.LONG_POLLING_AV, 150),
          n._thresholdMap.set(Bp.SEND_MESSAGE, 15),
          (n._lpID = ''),
          (n._platform = n.getPlatform()),
          (n._lastReportTime = 0),
          (n._statInfoArr = []),
          (n._retryCount = 0),
          (n._avgCalc = new Td(n._items)),
          (n._successRateCalc = new Md(n._items)),
          n.tim.innerEmitter.on(Sp.SIGN_LOGIN_SUCCESS, n._onLoginSuccess, kn(n)),
          n
        )
      }
      return (
        Dn(t, e),
        Tn(t, [
          {
            key: '_onLoginSuccess',
            value: function() {
              var e = this,
                t = this.tim.storage,
                n = t.getItem(this.TAG, !1)
              gu(n) ||
                (Gs.log(
                  'SumStatController._onLoginSuccess get sumstatlog in storage, nums=' + n.length
                ),
                n.forEach(function(t) {
                  e._statInfoArr.pushIn(t)
                }),
                t.removeItem(this.TAG, !1))
            }
          },
          {
            key: 'recordLongPollingID',
            value: function(e) {
              this._lpID = e
            }
          },
          {
            key: 'addTotalCount',
            value: function(e) {
              this._successRateCalc.addTotalCount(e)
                ? 1 === this._successRateCalc.getTotalCount(e) &&
                  (this._lastReportTime = Date.now())
                : Gs.warn('SumStatController.addTotalCount invalid key:', e)
            }
          },
          {
            key: 'addSuccessCount',
            value: function(e) {
              this._successRateCalc.addSuccessCount(e) ||
                Gs.warn('SumStatController.addSuccessCount invalid key:', e)
            }
          },
          {
            key: 'addCost',
            value: function(e, t) {
              this._avgCalc.push(e, t)
                ? (Gs.debug('SumStatController.addCost', e, t, this._avgCalc.getSize(e)),
                  this._avgCalc.getSize(e) >= this._thresholdMap.get(e) && this._report(e))
                : Gs.warn('SumStatController.addCost invalid key or cost:', e, t)
            }
          },
          {
            key: '_getItemNum',
            value: function(e) {
              switch (e) {
                case Bp.LONG_POLLING:
                  return 1
                case Bp.LONG_POLLING_AV:
                  return 2
                case Bp.SEND_MESSAGE:
                  return 3
                default:
                  return 100
              }
            }
          },
          {
            key: '_getStatInfo',
            value: function(e) {
              var t = null
              return (
                this._avgCalc.getSize(e) > 0 &&
                  (t = {
                    SDKAppID: ''.concat(this.tim.context.SDKAppID),
                    version: ''.concat(rn),
                    tinyID: this.tim.context.tinyID,
                    userID: this.tim.loginInfo.identifier,
                    item: this._getItemNum(e),
                    lpID: e === Bp.LONG_POLLING ? this._lpID : '',
                    platform: this._platform,
                    networkType: this.getNetworkType(),
                    total: this._successRateCalc.getTotalCount(e),
                    successRate: this._successRateCalc.getSuccessRate(e),
                    avg: this._avgCalc.getAvg(e),
                    timespan: Date.now() - this._lastReportTime,
                    time: Zs()
                  }),
                t
              )
            }
          },
          {
            key: '_report',
            value: function(e) {
              var t = this,
                n = [],
                r = null
              Bs(e)
                ? this._items.forEach(function(e) {
                    null !== (r = t._getStatInfo(e)) && n.push(r)
                  })
                : null !== (r = this._getStatInfo(e)) && n.push(r),
                Gs.debug('SumStatController._report', n),
                this._statInfoArr.length > 0 &&
                  ((n = n.concat(this.statInfoArr)), (this._statInfoArr = [])),
                this._doReport(n)
            }
          },
          {
            key: '_doReport',
            value: function(e) {
              var t = this
              if (gu(e)) Gs.warn('SumStatController._doReport statInfoArr is empty, do nothing')
              else {
                var n = this.createPackage({
                  name: 'ssoSumStat',
                  action: 'create',
                  param: { table: this.TABLE, report: e }
                })
                this.tim.connectionController
                  .request(n)
                  .then(function() {
                    ;(t._lastReportTime = Date.now()),
                      t._retryCount > 0 &&
                        (Gs.debug('SumStatController._doReport retry success'), (t._retryCount = 0))
                  })
                  .catch(function(n) {
                    Gs.warn(
                      'SumStatController._doReport, online:'.concat(t.getNetworkType(), ' error:'),
                      n,
                      e
                    ),
                      t._retryCount <= 1
                        ? setTimeout(function() {
                            Gs.info('SumStatController._doReport retry', e),
                              (t._retryCount += 1),
                              t._doReport(e)
                          }, 5e3)
                        : ((t._retryCount = 0),
                          (t._statInfoArr = t._statInfoArr.concat(e)),
                          t._flusgAtOnce())
                  })
              }
            }
          },
          {
            key: '_flushAtOnce',
            value: function() {
              var e = this.tim.storage,
                t = e.getItem(this.TAG, !1),
                n = this._statInfoArr
              if (gu(t))
                Gs.log('SumStatController._flushAtOnce nums=' + n.length),
                  e.setItem(this.TAG, n, !0, !1)
              else {
                var r = n.concat(t)
                r.length > 10 && (r = r.slice(0, 10)),
                  Gs.log('SumStatController._flushAtOnce nums=' + r.length),
                  e.setItem(this.TAG, r, !0, !1)
              }
              this._statInfoArr = []
            }
          },
          {
            key: 'reset',
            value: function() {
              Gs.info('SumStatController.reset'),
                this._report(),
                this._avgCalc.reset(),
                this._successRateCalc.reset()
            }
          }
        ]),
        t
      )
    })(wp),
    Ad = (function() {
      function e() {
        In(this, e), (this._funcMap = new Map())
      }
      return (
        Tn(e, [
          {
            key: 'defense',
            value: function(e, t) {
              var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0
              if ('string' != typeof e) return null
              if (0 === e.length) return null
              if ('function' != typeof t) return null
              if (this._funcMap.has(e) && this._funcMap.get(e).has(t))
                return this._funcMap.get(e).get(t)
              this._funcMap.has(e) || this._funcMap.set(e, new Map())
              var r = null
              return (
                this._funcMap.get(e).has(t)
                  ? (r = this._funcMap.get(e).get(t))
                  : ((r = this._pack(t, n)), this._funcMap.get(e).set(t, r)),
                r
              )
            }
          },
          {
            key: 'defenseOnce',
            value: function(e) {
              var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0
              return 'function' != typeof e ? null : this._pack(e, t)
            }
          },
          {
            key: 'find',
            value: function(e, t) {
              return 'string' != typeof e || 0 === e.length
                ? null
                : 'function' != typeof t
                ? null
                : this._funcMap.has(e)
                ? this._funcMap.get(e).has(t)
                  ? this._funcMap.get(e).get(t)
                  : (Gs.warn(
                      'SafetyCallback.find: 找不到此 func —— '
                        .concat(e, '/')
                        .concat('' !== t.name ? t.name : '[anonymous]')
                    ),
                    null)
                : (Gs.warn('SafetyCallback.find: 找不到此 eventName —— '.concat(e)), null)
            }
          },
          {
            key: 'delete',
            value: function(e, t) {
              return (
                'function' == typeof t &&
                !!this._funcMap.has(e) &&
                  !!this._funcMap.get(e).has(t) &&
                    (this._funcMap.get(e).delete(t),
                    0 === this._funcMap.get(e).size && this._funcMap.delete(e),
                    !0)
              )
            }
          },
          {
            key: '_pack',
            value: function(e, t) {
              return function() {
                try {
                  e.apply(t, Array.from(arguments))
                } catch (n) {
                  console.error(n)
                }
              }
            }
          }
        ]),
        e
      )
    })(),
    Dd = (function() {
      function e(t) {
        In(this, e)
        var n = new Hp()
        n.setMethod(jp.SDK_CONSTRUCT).setStart(),
          Gp.mixin(this),
          this._initOptions(t),
          this._initMemberVariables(),
          this._initControllers(),
          this._initListener(),
          Hp.bindController(this.eventStatController),
          n
            .setCode(0)
            .setText('mp='.concat(es, '-ua=').concat(ts))
            .setEnd(),
          Gs.info(
            'SDK inWxMiniApp:'
              .concat(es, ', SDKAppID:')
              .concat(t.SDKAppID, ', UserAgent:')
              .concat(ts)
          ),
          (this._safetyCallbackFactory = new Ad())
      }
      return (
        Tn(e, [
          {
            key: 'login',
            value: function(e) {
              return (
                Gs.time(Bp.SDK_READY),
                (this._ssoLog = new Hp()),
                this._ssoLog.setMethod(jp.SDK_READY).setStart(),
                this.netMonitor.start(),
                (this.loginInfo.identifier = e.identifier || e.userID),
                (this.loginInfo.userSig = e.userSig),
                this.signController.login(this.loginInfo)
              )
            }
          },
          {
            key: 'logout',
            value: function() {
              var e = this.signController.logout()
              return this.resetSDK(), e
            }
          },
          {
            key: 'on',
            value: function(e, t, n) {
              Gs.debug('on', 'eventName:'.concat(e)),
                this.outerEmitter.on(e, this._safetyCallbackFactory.defense(e, t, n), n)
            }
          },
          {
            key: 'once',
            value: function(e, t, n) {
              Gs.debug('once', 'eventName:'.concat(e)),
                this.outerEmitter.once(e, this._safetyCallbackFactory.defenseOnce(t, n), n || this)
            }
          },
          {
            key: 'off',
            value: function(e, t, n, r) {
              Gs.debug('off', 'eventName:'.concat(e))
              var o = this._safetyCallbackFactory.find(e, t)
              null !== o &&
                (this.outerEmitter.off(e, o, n, r), this._safetyCallbackFactory.delete(e, t))
            }
          },
          {
            key: 'registerPlugin',
            value: function(e) {
              var t = this
              this.plugins || (this.plugins = {}),
                Object.keys(e).forEach(function(n) {
                  t.plugins[n] = e[n]
                })
            }
          },
          {
            key: 'getPlugin',
            value: function(e) {
              return this.plugins[e] || void 0
            }
          },
          {
            key: 'setLogLevel',
            value: function(e) {
              if (e <= 0) {
                console.log(
                  [
                    '',
                    ' ________  ______  __       __  __       __  ________  _______',
                    '|        \\|      \\|  \\     /  \\|  \\  _  |  \\|        \\|       \\',
                    ' \\$$$$$$$$ \\$$$$$$| $$\\   /  $$| $$ / \\ | $$| $$$$$$$$| $$$$$$$\\',
                    '   | $$     | $$  | $$$\\ /  $$$| $$/  $\\| $$| $$__    | $$__/ $$',
                    '   | $$     | $$  | $$$$\\  $$$$| $$  $$$\\ $$| $$  \\   | $$    $$',
                    '   | $$     | $$  | $$\\$$ $$ $$| $$ $$\\$$\\$$| $$$$$   | $$$$$$$\\',
                    '   | $$    _| $$_ | $$ \\$$$| $$| $$$$  \\$$$$| $$_____ | $$__/ $$',
                    '   | $$   |   $$ \\| $$  \\$ | $$| $$$    \\$$$| $$     \\| $$    $$',
                    '    \\$$    \\$$$$$$ \\$$      \\$$ \\$$      \\$$ \\$$$$$$$$ \\$$$$$$$',
                    '',
                    ''
                  ].join('\n')
                ),
                  console.log(
                    '%cIM 智能客服，随时随地解决您的问题 →_→ https://cloud.tencent.com/act/event/smarty-service?from=im-doc',
                    'color:#ff0000'
                  )
                console.log(
                  [
                    '',
                    '参考以下文档，会更快解决问题哦！(#^.^#)\n',
                    'SDK 更新日志: https://cloud.tencent.com/document/product/269/38492\n',
                    'SDK 接口文档: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html\n',
                    '常见问题: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/tutorial-01-faq.html\n',
                    '反馈问题？戳我提 issue: https://github.com/tencentyun/TIMSDK/issues\n',
                    '如果您需要在生产环境关闭上面的日志，请 tim.setLogLevel(1)\n'
                  ].join('\n')
                )
              }
              Gs.setLevel(e)
            }
          },
          {
            key: 'downloadLog',
            value: function() {
              var e = document.createElement('a'),
                t = new Date(),
                n = new Blob(this.getLog())
              ;(e.download =
                'TIM-' +
                t.getFullYear() +
                '-' +
                (t.getMonth() + 1) +
                '-' +
                t.getDate() +
                '-' +
                this.loginInfo.SDKAppID +
                '-' +
                this.context.identifier +
                '.txt'),
                (e.href = URL.createObjectURL(n)),
                e.click(),
                URL.revokeObjectURL(n)
            }
          },
          {
            key: 'destroy',
            value: function() {
              this.logout(),
                this.outerEmitter.emit(on.SDK_DESTROY, { SDKAppID: this.loginInfo.SDKAppID })
            }
          },
          {
            key: 'createTextMessage',
            value: function(e) {
              return this.messageController.createTextMessage(e)
            }
          },
          {
            key: 'createImageMessage',
            value: function(e) {
              return this.messageController.createImageMessage(e)
            }
          },
          {
            key: 'createAudioMessage',
            value: function(e) {
              return this.messageController.createAudioMessage(e)
            }
          },
          {
            key: 'createVideoMessage',
            value: function(e) {
              return this.messageController.createVideoMessage(e)
            }
          },
          {
            key: 'createCustomMessage',
            value: function(e) {
              return this.messageController.createCustomMessage(e)
            }
          },
          {
            key: 'createFaceMessage',
            value: function(e) {
              return this.messageController.createFaceMessage(e)
            }
          },
          {
            key: 'createFileMessage',
            value: function(e) {
              return this.messageController.createFileMessage(e)
            }
          },
          {
            key: 'sendMessage',
            value: function(e) {
              return e instanceof pp
                ? this.messageController.sendMessageInstance(e)
                : Kp(
                    new np({
                      code: rp.MESSAGE_SEND_NEED_MESSAGE_INSTANCE,
                      message: op.MESSAGE_SEND_NEED_MESSAGE_INSTANCE
                    })
                  )
            }
          },
          {
            key: 'revokeMessage',
            value: function(e) {
              return this.messageController.revokeMessage(e)
            }
          },
          {
            key: 'resendMessage',
            value: function(e) {
              return this.messageController.resendMessage(e)
            }
          },
          {
            key: 'getMessageList',
            value: function(e) {
              return this.messageController.getMessageList(e)
            }
          },
          {
            key: 'setMessageRead',
            value: function(e) {
              return this.messageController.setMessageRead(e)
            }
          },
          {
            key: 'getConversationList',
            value: function() {
              return this.conversationController.getConversationList()
            }
          },
          {
            key: 'getConversationProfile',
            value: function(e) {
              return this.conversationController.getConversationProfile(e)
            }
          },
          {
            key: 'deleteConversation',
            value: function(e) {
              return this.conversationController.deleteConversation(e)
            }
          },
          {
            key: 'getMyProfile',
            value: function() {
              return this.userController.getMyProfile()
            }
          },
          {
            key: 'getUserProfile',
            value: function(e) {
              return this.userController.getUserProfile(e)
            }
          },
          {
            key: 'updateMyProfile',
            value: function(e) {
              return this.userController.updateMyProfile(e)
            }
          },
          {
            key: 'getFriendList',
            value: function() {
              return this.userController.getFriendList()
            }
          },
          {
            key: 'deleteFriend',
            value: function(e) {
              return this.userController.deleteFriend(e)
            }
          },
          {
            key: 'getBlacklist',
            value: function() {
              return this.userController.getBlacklist()
            }
          },
          {
            key: 'addToBlacklist',
            value: function(e) {
              return this.userController.addBlacklist(e)
            }
          },
          {
            key: 'removeFromBlacklist',
            value: function(e) {
              return this.userController.deleteBlacklist(e)
            }
          },
          {
            key: 'getGroupList',
            value: function(e) {
              return this.groupController.getGroupList(e)
            }
          },
          {
            key: 'getGroupProfile',
            value: function(e) {
              return this.groupController.getGroupProfile(e)
            }
          },
          {
            key: 'createGroup',
            value: function(e) {
              return this.groupController.createGroup(e)
            }
          },
          {
            key: 'dismissGroup',
            value: function(e) {
              return this.groupController.dismissGroup(e)
            }
          },
          {
            key: 'updateGroupProfile',
            value: function(e) {
              return this.groupController.updateGroupProfile(e)
            }
          },
          {
            key: 'joinGroup',
            value: function(e) {
              return this.groupController.joinGroup(e)
            }
          },
          {
            key: 'quitGroup',
            value: function(e) {
              return this.groupController.quitGroup(e)
            }
          },
          {
            key: 'searchGroupByID',
            value: function(e) {
              return this.groupController.searchGroupByID(e)
            }
          },
          {
            key: 'changeGroupOwner',
            value: function(e) {
              return this.groupController.changeGroupOwner(e)
            }
          },
          {
            key: 'handleGroupApplication',
            value: function(e) {
              return this.groupController.handleGroupApplication(e)
            }
          },
          {
            key: 'setMessageRemindType',
            value: function(e) {
              return this.groupController.setMessageRemindType(e)
            }
          },
          {
            key: 'getGroupMemberList',
            value: function(e) {
              return this.groupController.getGroupMemberList(e)
            }
          },
          {
            key: 'getGroupMemberProfile',
            value: function(e) {
              return this.groupController.getGroupMemberProfile(e)
            }
          },
          {
            key: 'addGroupMember',
            value: function(e) {
              return this.groupController.addGroupMember(e)
            }
          },
          {
            key: 'deleteGroupMember',
            value: function(e) {
              return this.groupController.deleteGroupMember(e)
            }
          },
          {
            key: 'setGroupMemberMuteTime',
            value: function(e) {
              return this.groupController.setGroupMemberMuteTime(e)
            }
          },
          {
            key: 'setGroupMemberRole',
            value: function(e) {
              return this.groupController.setGroupMemberRole(e)
            }
          },
          {
            key: 'setGroupMemberNameCard',
            value: function(e) {
              return this.groupController.setGroupMemberNameCard(e)
            }
          },
          {
            key: 'setGroupMemberCustomField',
            value: function(e) {
              return this.groupController.setGroupMemberCustomField(e)
            }
          },
          {
            key: '_initOptions',
            value: function(e) {
              ;(this.plugins = {}),
                (this.loginInfo = {
                  SDKAppID: e.SDKAppID || null,
                  accountType: tu(),
                  identifier: null,
                  userSig: null
                }),
                (this.options = {
                  runLoopNetType: e.runLoopNetType || bl,
                  enablePointer: e.enablePointer || !1
                })
            }
          },
          {
            key: '_initMemberVariables',
            value: function() {
              ;(this.context = null),
                (this.innerEmitter = new ed()),
                (this.outerEmitter = new ed()),
                qp(this.outerEmitter),
                (this.packageConfig = new nd(this)),
                (this.storage = new Zg(this)),
                (this.netMonitor = new Cd()),
                (this.outerEmitter._emit = this.outerEmitter.emit),
                (this.outerEmitter.emit = function(e, t) {
                  var n = arguments[0],
                    r = [n, { name: arguments[0], data: arguments[1] }]
                  Gs.debug('emit '.concat(n), r[1]),
                    this.outerEmitter._emit.apply(this.outerEmitter, r)
                }.bind(this))
            }
          },
          {
            key: '_initControllers',
            value: function() {
              ;(this.exceptionController = new ug(this)),
                (this.connectionController = new sg(this)),
                (this.contextController = new Up(this)),
                (this.signController = new Yp(this)),
                (this.messageController = new Vg(this)),
                (this.conversationController = new Dg(this)),
                (this.userController = new _g(this)),
                (this.groupController = new $g(this)),
                (this.notificationController = new od(this)),
                (this.bigDataHallwayController = new ad(this)),
                (this.statusController = new Jg(this)),
                (this.uploadController = new id(this)),
                (this.eventStatController = new Ed(this)),
                (this.sumStatController = new Od(this)),
                (this.mtaReportController = new yd(this)),
                this._initReadyListener()
            }
          },
          {
            key: '_initListener',
            value: function() {
              var e = this
              if (
                (this.innerEmitter.on(
                  Sp.NOTICE_LONGPOLL_LONG_RECONNECT,
                  this._onNoticeChannelReconnectedAfterLongTime,
                  this
                ),
                es && 'function' == typeof wx.onAppShow && 'function' == typeof wx.onAppHide)
              ) {
                var t = null
                wx.onAppHide(function() {
                  ;(t = new Hp()).setMethod(jp.MP_HIDE_TO_SHOW).setStart()
                }),
                  wx.onAppShow(function() {
                    null !== t &&
                      t
                        .setCode(0)
                        .setNetworkType(e.netMonitor.getNetworkType())
                        .setEnd()
                  })
              }
            }
          },
          {
            key: '_initReadyListener',
            value: function() {
              for (var e = this, t = this.readyList, n = 0, r = t.length; n < r; n++)
                this[t[n]].ready(function() {
                  return e._readyHandle()
                })
            }
          },
          {
            key: '_onNoticeChannelReconnectedAfterLongTime',
            value: function(e) {
              Gs.log('reconnect after long time...', e),
                this.notificationController.closeNoticeChannel(),
                this.resetSDK(),
                this.login(this.loginInfo)
            }
          },
          {
            key: 'resetSDK',
            value: function() {
              var e = this
              this.initList.forEach(function(t) {
                e[t].reset && e[t].reset()
              }),
                this.netMonitor.reset(),
                this.storage.reset(),
                this.resetReady(),
                this._initReadyListener(),
                this.outerEmitter.emit(on.SDK_NOT_READY)
            }
          },
          {
            key: '_readyHandle',
            value: function() {
              for (var e = this.readyList, t = !0, n = 0, r = e.length; n < r; n++)
                if (!this[e[n]].isReady()) {
                  t = !1
                  break
                }
              if (t) {
                var o = Gs.timeEnd(Bp.SDK_READY)
                Gs.warn('SDK is ready. cost='.concat(o, 'ms')),
                  this.triggerReady(),
                  this.innerEmitter.emit(Sp.SDK_READY),
                  this.outerEmitter.emit(on.SDK_READY),
                  this._ssoLog
                    .setCode(0)
                    .setNetworkType(this.netMonitor.getNetworkType())
                    .setText(o)
                    .setEnd()
              }
            }
          }
        ]),
        e
      )
    })()
  ;(Dd.prototype.readyList = ['conversationController']),
    (Dd.prototype.initList = [
      'exceptionController',
      'connectionController',
      'signController',
      'contextController',
      'messageController',
      'conversationController',
      'userController',
      'groupController',
      'notificationController',
      'eventStatController',
      'sumStatController'
    ])
  var Nd = {
    login: 'login',
    on: 'on',
    off: 'off',
    ready: 'ready',
    setLogLevel: 'setLogLevel',
    joinGroup: 'joinGroup',
    quitGroup: 'quitGroup',
    registerPlugin: 'registerPlugin'
  }
  function Rd(e, t) {
    return (
      !(!e.isReady() && void 0 === Nd[t]) ||
      (e.innerEmitter.emit(
        Sp.ERROR_DETECTED,
        new np({
          code: rp.SDK_IS_NOT_READY,
          message: ''
            .concat(t, ' ')
            .concat(
              op.SDK_IS_NOT_READY,
              '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/module-EVENT.html#.SDK_READY'
            )
        })
      ),
      !1)
    )
  }
  var Ld = {},
    Pd = {}
  return (
    (Pd.create = function(e) {
      if (e.SDKAppID && Ld[e.SDKAppID]) return Ld[e.SDKAppID]
      Gs.log('TIM.create')
      var t = new Dd(e)
      t.on(on.SDK_DESTROY, function(e) {
        ;(Ld[e.data.SDKAppID] = null), delete Ld[e.data.SDKAppID]
      })
      var n = (function(e) {
        var t = Object.create(null)
        return (
          Object.keys(fp).forEach(function(n) {
            if (e[n]) {
              var r = fp[n],
                o = new Un()
              t[r] = function() {
                var t = Array.from(arguments)
                return (
                  o
                    .use(function(t, r) {
                      if (Rd(e, n)) return r()
                    })
                    .use(function(e, t) {
                      if (!0 === du(e, hp[n], r)) return t()
                    })
                    .use(function(t, r) {
                      return e[n].apply(e, t)
                    }),
                  o.run(t)
                )
              }
            }
          }),
          t
        )
      })(t)
      return (Ld[e.SDKAppID] = n), Gs.log('TIM.create ok'), n
    }),
    (Pd.TYPES = an),
    (Pd.EVENT = on),
    (Pd.VERSION = rn),
    Gs.log('TIM.VERSION: '.concat(Pd.VERSION)),
    Pd
  )
})
